Hello- I have a master tab in my spreadsheet set up as follows:
store name total shipped(feb) total shipped(march) etc for all months
store a
store b
store c
etc
I then have separate tabs with each month that have the store names in a list(if they ordered that particular month) and total shipped.
I am trying to use the Index and Match functions and not having luck. Here is the formula I have so far:
=INDEX('Feb ''11'!P12:P19,MATCH(1,($A12='Feb ''11'!A12:N123),0))
Can anyone tell me what is wrong with it? Also, if there is no store to reference, how do I have it return a 0 instead of #n/a??
Any help would be greatly appreciated!
The two dimensional lookup array (A12:N123) in the MATCH function is likely the culprit.
Cheers,
“To sin by silence when they should protest makes cowards of men.” ~ Abraham Lincoln
Sorry. that was a typo. it really should have been just in the A column for the match.
Place a double unary in front of the lookup array:
and confrim with Ctrl-Shift-Enter.=INDEX('Feb ''11'!P12:P19,MATCH(1,--($A12='Feb ''11'!A12:A123),0))
Cheers,
“To sin by silence when they should protest makes cowards of men.” ~ Abraham Lincoln
Thank you that worked. What does the -- mean? Also, is there a way to eliminate an #n/a from coming back if no data is there? Could a sumproduct equation be used instead?
I also recommend you avoid using apostrophes (') in your tab names.
“To sin by silence when they should protest makes cowards of men.” ~ Abraham Lincoln
Your MATCH function can return a row number up to 111, but your INDEX function array has only 8 rows. Is this another typo?
To avoid the NA#, try using an IF & COUNTIF combination like this:
Cheers,=IF(COUNTIF('Feb ''11'!A12:A123,$A12),INDEX('Feb ''11'!P12:P19,MATCH(1,--($A12='Feb ''11'!A12:A123),0)),0)
Last edited by ConneXionLost; 10-20-2011 at 12:35 PM.
“To sin by silence when they should protest makes cowards of men.” ~ Abraham Lincoln
The Double Unary (--) are a method of coercion, which is a way to convert a Boolean value (TRUE or FALSE) to its numeric equivalent (1 or 0). There are several ways to accomplish it, (adding a zero, or multiplying by 1 are examples). One of the, if not the, fastest and most efficient ways is to use two negation operators together, which changes the sign twice, resulting in a numeric value.
“To sin by silence when they should protest makes cowards of men.” ~ Abraham Lincoln
Thanks again! That worked. Now, instead of returning n/a. I get a blank and can't subtotal. is there an ifblank statement I can add to my sum equation? Oh and the column ranges were incorrect. sorry about all of my typos!
So, can you show the formula you now have (without the typos)?
“To sin by silence when they should protest makes cowards of men.” ~ Abraham Lincoln
Here it is:
=IF(COUNTIF('Feb 11'!$A$12:$A$200,$A11),INDEX('Feb 11'!$P$12:$P$200,MATCH(1,--($A11='Feb 11'!$A$12:$A$200),0)),"")
Also, I should say when I am trying to total, it is every other cell ie b11+e11+611 etc.. and not a range.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks