Using Index and Match, returning a value but changing this value based on what is returned.

HeXiao

New Member
Joined
Sep 24, 2017
Messages
1
Hi all

I am using Index and Match to return values off another sheet, e.g

=INDEX(!Sheet1A:A,MATCH(D2,!Sheet1B:B))

However there are some values that are being returned which I want to appear differently, these values are:
0
1900

I would like 0 to appear as "X" and 1900 to appear as "Y". All other values are fine and display as I want them.

Is there anyway I can use an IF condition with this INDEX and MATCH statement together to return X and Y value if anything with 0 or 1900 appear?

Thank you
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Like this...

=IFERROR(VLOOKUP(INDEX(Sheet1!A:A,MATCH(D2,Sheet1!B:B,1)),{0,"X";1900,"Y"},2,0),INDEX(Sheet1!A:A,MATCH(D2,Sheet1!B:B,1)))
 
Upvote 0
Maybe it's not most elegant solution but it should work.

Code:
=IF(INDEX(!Sheet1A:A,MATCH(D2,!Sheet1B:B))=0,"X",IF(INDEX(!Sheet1A:A,MATCH(D2,!Sheet1B:B))=1900,"Y",INDEX(!Sheet1A:A,MATCH(D2,!Sheet1B:B))))
 
Upvote 0

Forum statistics

Threads
1,216,211
Messages
6,129,528
Members
449,515
Latest member
lukaderanged

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