Can the "Lookup" formula be used to find separate values instead of a range?

RockandGrohl

Well-known Member
Joined
Aug 1, 2018
Messages
810
Office Version
  1. 365
Platform
  1. Windows
I found this formula which returns the rightmost non-blank cell in a range:

=LOOKUP(2,1/(P7:S7<>""),P7:S7)

Can I instead specify, like... M7, O7, Q7, S7?


Cheers.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Not sure what your layout is but maybe use an override cell i.e.
Code:
A1: =LOOKUP(2,1/(P7:S7<>""),P7:S7)
B1: =M7
C1: =IF(LEN(B1)>0,B1,A1)
Delete B1 if you want C1 to show A1, else enter specific into B1
 
Last edited:
Upvote 0
Hi Jack, thanks for the reply.

The lookup range is H:S, however the only cells I want to get the right-most value for are H, K, N and Q - Every cell with 2 cells in between.
 
Upvote 0
Because you have a pattern you could use this:

=LOOKUP(2,1/((M7:S7<>"")*(ISODD(COLUMN(M7:S7)))),M7:S7)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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