Hi Guys,
I am using the following formula:
The goal is to return a list of companies incorporated between the relevant dates.
You might ask:
Hopefully that eliminates some questions, but if you know a why to make it work despite my perception of the problem please let me know.
So, the first part of the formula works fine. It pulls the first company and if there was only one I would be done. Obviously there can be more than one. So my idea was to look up instances where the companies pulled are the same as those being searched, if they are the formula should return -1 for that part of the array reducing the total to 1, thereby making the match false.
When I evaluated the formula it turns out that instead of returning false when the names are being compared and they don't match, the formula is returning #N/A. This screws everything up and "0" is returned. Interestingly this only happens when it is comparing 2 or more values with the main listing. IE the following is the output:
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]A1 Company[/TD]
[TD]{=INDEX(A!$B$2:$B$5000,MATCH(2,(A!$C$2:$C$5000>'New Companies'!$C$2)*1+('New Companies'!$C$3>A!$C$2:$C$5000)*1,0))}[/TD]
[/TR]
[TR]
[TD]ABC Company[/TD]
[TD]{=INDEX(A!$B$2:$B$5000,MATCH(2,(A!$C$2:$C$5000>'New Companies'!$C$2)*1+('New Companies'!$C$3>A!$C$2:$C$5000)*1-(A!$B$2:$B$5000='New Companies'!B$5:B5)*1,0))}[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]Same as above[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]Same as above[/TD]
[/TR]
</tbody>[/TABLE]
Does anyone have an experience on this or know of an alternate solution?
Thanks
I am using the following formula:
Code:
{=INDEX(A!$B$2:$B$5000,MATCH(2,(A!$C$2:$C$5000>'New Companies'!$C$2)*1+('New Companies'!$C$3>A!$C$2:$C$5000)*1-(A!$B$2:$B$5000='New Companies'!B$5:B5)*1,0))}
A!$B$2:$B$5000 = A range of company names
A!$C$2:$C$5000 = A range of incorporation dates of companies
'New Companies'!$C$2 = The start of a date range
'New Companies'!$C$3 = The end of the date range
'New Companies'!B$5:B5 = The names of previously returned companies
The goal is to return a list of companies incorporated between the relevant dates.
You might ask:
- Why not just filter by date? Answer: There is one tab for each letter that the company starts with. I also want a "home screen" where I can glance and see the information without having to do anything.
- Why not put all the data into a single tab? Answer: The data pulls from a website and the website only allows you to access the information letter by letter.
- Why not pull the data from the site on the same tab? Answer: The number of companies changes.
Hopefully that eliminates some questions, but if you know a why to make it work despite my perception of the problem please let me know.
So, the first part of the formula works fine. It pulls the first company and if there was only one I would be done. Obviously there can be more than one. So my idea was to look up instances where the companies pulled are the same as those being searched, if they are the formula should return -1 for that part of the array reducing the total to 1, thereby making the match false.
When I evaluated the formula it turns out that instead of returning false when the names are being compared and they don't match, the formula is returning #N/A. This screws everything up and "0" is returned. Interestingly this only happens when it is comparing 2 or more values with the main listing. IE the following is the output:
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]A1 Company[/TD]
[TD]{=INDEX(A!$B$2:$B$5000,MATCH(2,(A!$C$2:$C$5000>'New Companies'!$C$2)*1+('New Companies'!$C$3>A!$C$2:$C$5000)*1,0))}[/TD]
[/TR]
[TR]
[TD]ABC Company[/TD]
[TD]{=INDEX(A!$B$2:$B$5000,MATCH(2,(A!$C$2:$C$5000>'New Companies'!$C$2)*1+('New Companies'!$C$3>A!$C$2:$C$5000)*1-(A!$B$2:$B$5000='New Companies'!B$5:B5)*1,0))}[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]Same as above[/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]Same as above[/TD]
[/TR]
</tbody>[/TABLE]
Does anyone have an experience on this or know of an alternate solution?
Thanks