Search on text

uivandals

Board Regular
Joined
May 8, 2003
Messages
52
I need to firure out how to find a value based on 2 conditions that are text. Somewhat like this: If customer "acme" is in the central division and in state Alaska, return legal entity Newco. Anyone know what formula will do that?
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Assuming you have a table with customers in column A state in B and "legal entities" in column C then try

=INDEX(C$2:C$100,MATCH(1,(A$2:A$100="acme")*(B$2:B$100="Alaska"),0))

confirmed with CTRL+SHIFT+ENTER
 
Upvote 0
Yes, that would be the preferred method, if customer is in F2 and state in G2

=INDEX(C$2:C$100,MATCH(1,(A$2:A$100=F2)*(B$2:B$100=G2),0))
 
Upvote 0
That's the formula that I have and it is returning #N/A.

=INDEX(Sheet1!$C1:$C5000,MATCH(1,(Sheet1!$E1:$E5000=B5)*(Sheet1!$B1:$B5000=$D:$D),0))

Column c on sheet 1 is legal entity
Column e on sheet 1 is division
Column b on sheet 1 is state
 
Upvote 0
This part

Sheet1!$B1:$B5000=$D:$D

refers to the whole of column D, shouldn't this be a single cell (containing a specific state)?

Make sure you confirm formula with CTRL+SHIFT+ENTER so that curly braces like { and } appear around the formula in the formula bar
 
Upvote 0
You can't use whole column refs in an array formula so the $D:$D bit will cause failure. Shouldn't this be a single cell reference in any case?
 
Upvote 0
Yep, that was the issue, thanks. If I needed to add a third condition, how would that change the formula?
 
Upvote 0
IF you also want column F to equal D5 try

=INDEX(Sheet1!$C1:$C5000,MATCH(1,(Sheet1!$E1:$E5000=B5)*(Sheet1!$B1:$B5000=C5)*(Sheet1!$F1:$F5000=D5),0))
 
Last edited by a moderator:
Upvote 0

Forum statistics

Threads
1,221,607
Messages
6,160,787
Members
451,671
Latest member
kkeller10

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top