Select Value +Return Value Based on Data Location.

Roj47

Board Regular
Joined
May 4, 2011
Messages
65
Office Version
  1. 365
Platform
  1. Windows
Hi, and do feel a little daft asking this as it seems so easy (?).

I have data (numeric e.g. 47 and test e.g. DT) which are entered into a handful of cells in a row.

There are 10 columns (D to M) with the current most recent position as you get to M.

Is there a function that I can enter into Column N to return the entered value closest to Column N i.e.

If Column E has 47, I would like Column N to return 47; If I enter DT into column L, then the value in Column N returns DT.... Likewise if I remove DT from column L the value reverts back to 47.

Searching keeps helping me get the closest value in a different way.

Thank you.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

How about
Excel Formula:
=LOOKUP(2,1/(D2:M2<>""),D2:M2)
 
Upvote 0
Solution
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

How about
Excel Formula:
=LOOKUP(2,1/(D2:M2<>""),D2:M2)

I have checked the 365 option and my platform - Thank you for pointing out this had not happened.

The solution was perfect, thank you on this also.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
This is what I got
Excel Formula:
=IFERROR(IF(IFERROR(XMATCH(47,D1:M1,0,-1),0)>IFERROR(XMATCH("DT",D1:M1,0,-1),0),INDEX(D1:M1,1,XMATCH(47,D1:M1,0,-1)),INDEX(D1:M1,1,XMATCH("DT",D1:M1,0,-1))),"None")
Fluffs is better, I misread your post in thinking those were the only 2 things you wanted to test for
 
Upvote 0

Forum statistics

Threads
1,214,393
Messages
6,119,261
Members
448,880
Latest member
aveternik

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