Insert 2 INDEX/MATCH functions into an IF function

Ecam39 Posted messages 314 Status Member -  
Ecam39 Posted messages 314 Status Member -
Hello,

I need to look up a transport cost in a pricing grid based on two criteria (quantity + Department). For this, I combined the INDEX + MATCH functions, which gives this:

=INDEX(Price Grid;MATCH(Lookup Value;department list;0);MATCH(Lookup Value;palette quantity list;0))

I just need to enter the number of palettes and the delivery department, and I have my price.

But I would like to insert a second pricing grid and have Excel say that if, for example, the quantity is less than 10, then it will look for the price in grid A (INDEX + MATCH grid A), if it is above (thus false value), it will take from grid B (INDEX + MATCH grid B)
This results in 2 INDEX + MATCH functions, but I do not know how to write it. I tried to put brackets to clearly separate the TRUE and FALSE values, but it does not recognize them.

For now, I wrote it like this:

=IF(B5<10;INDEX(Price Grid A;MATCH(Lookup Value;department list;0);MATCH(Lookup Value;palette quantity list;0);INDEX(Price Grid B;MATCH(Lookup Value;department list;0);MATCH(Lookup Value;palette quantity list;0))

What is in bold corresponds to the TRUE part, and the rest to the FALSE part

Configuration: Windows 7 / Internet Explorer 9.0

7 answers

chossette9 Posted messages 6855 Registration date   Status Contributor Last intervention   1 313
 
Hello,

your formula is missing parentheses. If you count correctly, you have 7 opening parentheses but only 5 closing parentheses.

Try this:
=IF(B5<10;INDEX(Price Grid A;MATCH(Looked-up Value;department list;0);MATCH(Looked-up Value;palette quantity list;0));INDEX(Price Grid B;MATCH(Looked-up Value;department list;0);MATCH(Looked-up Value;palette quantity list;0))) 

The bolded parentheses are the ones I added, and they correspond to the opening parentheses of the INDEX functions that you hadn't closed.

Best regards.
--
This guy wasn't very bright, because he was foolish.
0
Ecam39 Posted messages 314 Status Member 9
 
The parentheses, Excel corrects them automatically. But it doesn't come from the parentheses :(
0
Ecam39 Posted messages 314 Status Member 9
 
I found it :)
It’s indeed a parentheses issue. Where I had put brackets, I needed to put parentheses.
Thank you
0
tontong Posted messages 2575 Registration date   Status Member Last intervention   1 064
 
Hello,
There is another form of the Index function: INDEX(ref; row_num; column_num; area_num)
Which would give =INDEX((GridA; GridB); MATCH(Value sought; department list; 0); MATCH(Value sought; palette quantity list; 0); IF(B5>10; 1; 2)
Where GridA is a field of values (without headers)

Other procedures are possible. You can define the field with an Offset function or with Indirect and named fields.
0
Ecam39 Posted messages 314 Status Member 9
 
In the MATCH functions, it doesn't know which array to search in.
Compared to INDEX, it knows which array to take (1 or 2), but for the MATCH functions, the headers are not the same.
0
tontong Posted messages 2575 Registration date   Status Member Last intervention   1 064
 
Re,
It will be clearer with an example:
https://www.cjoint.com/?3Kcskm0L9bL
0
Ecam39 Posted messages 314 Status Member 9
 
It's shorter with this formula :)
0
Ecam39 Posted messages 314 Status Member 9
 
I managed to find out that where I wanted to put brackets, I should have used parentheses; it's that simple^^

I have trouble understanding how a VLOOKUP can replace a combination of INDEX+MATCH and on top of that, on 2 different grids.
-1
PHILOU10120 Posted messages 6463 Registration date   Status Contributor Last intervention   834
 
Just look at the example in the attachment
there are two criteria, one in the row and the other in the column, it's not complicated.
0
Ecam39 Posted messages 314 Status Member 9
 
I see how the formula works, but how come for the line of the number of pallets, we don't use a VLOOKUP instead of a MATCH?
-1
PHILOU10120 Posted messages 6463 Registration date   Status Contributor Last intervention   834
 
It's not useful; the number of pallets gives the column number.
0
PHILOU10120 Posted messages 6463 Registration date   Status Contributor Last intervention   834
 
Hello

An example with a simple searchV

https://www.cjoint.com/?3KcmvgmBwyp
-3