Look up multiple columns for cell value

surkdidat

Well-known Member
Joined
Oct 1, 2011
Messages
580
Office Version
  1. 365
Hi

I have data in columns A:E. Cell F2 I have a date. What I need is t look at A2:E2 and return either F1 (column header name) or a 0 if f2 value is not in that row.

Many thanks
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
This is bringing up false, even though in D2 I have the same value as in F2... Also I need it to bring up the column header of A1:E1 that the value is in... So if it was in D2, I want the answer as D1, if the answer was in E2, I want the anser as E1 (Apologies stated that wrong to begin with)
=if(ifna(match(f2,a2:e2,0),0)=0,f1)
 
Upvote 0
Hi,

Is this what you mean:


Book1
ABCDEFG
1Hear AHear BHear CHear DHear E
212/1/201812/2/201812/3/201812/4/201812/5/201812/12/20180
312/10/201812/11/201812/12/201812/13/201812/14/201812/13/2018Hear D
Sheet387
Cell Formulas
RangeFormula
G2=IFERROR(INDEX(A$1:E$1,MATCH(F2,A2:E2,0)),0)
 
Last edited:
Upvote 0
I would like to point out that using IFERROR instead of IFNA would return a 0 for every error, opposed to only for when the value is not present. This could cause unwanted results in case of unexpected errors other than #N/A
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,698
Members
448,979
Latest member
DET4492

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