Find the last cell value in a non-adjacent named range

beninoz

New Member
Joined
Aug 31, 2022
Messages
4
Office Version
  1. 365
Platform
  1. Windows
I need to find the last cell value in a non-adjacent named range.
I've tried the following formula with adjacent cells and it works fine, just NOT In a non-adjacent range.
I've named the range = REVs {=MASTER!$V$4,MASTER!$AB$4,MASTER!$AH$4,MASTER!$AN$4,MASTER!$AT$4,MASTER!$AZ$4,MASTER!$BF$4,MASTER!$BL$4,MASTER!$BR$4}
Formula: =LOOKUP(2,1/(REVs<>""),REVs)

I have a cumbersome formula that does work however but I'd like to make it better:
=SINGLE(IF((SINGLE(REV_9))="",IF((SINGLE(REV_8))="",IF((SINGLE(REV_7))="",IF((SINGLE(REV_6))="",IF((SINGLE(REV_5))="",IF((SINGLE(REV_4))="",IF((SINGLE(REV_3))="",IF((SINGLE(REV_2))="",IF((SINGLE(REV_1))="","",REV_1),REV_2),REV_3),REV_4),REV_5),REV_6),REV_7),REV_8),REV_9))
Thanks!!
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Assuming your version of Office 365 has caught up to the recent update where VSTACK was released, you can use that new function to *make* an adjacent array and envoke the same formula you were using before:

=LET(x,VSTACK(REVs),LOOKUP(2,1/(x<>""),x))
 
Upvote 0
Solution
Brilliant!! Thanks so much. I wasn't aware of the VSTACK function.
 
Upvote 0
Next question if I may:
How do I make the named range (REVs) dynamic (for the rest of the rows down - row 4, 5, 6 etc.)?
I've tried to make the columns constants and the rows dynamic but it doesn't work.
e.g. {=MASTER!$V4,MASTER!$AB4,MASTER!$AH$,MASTER!$AN4,MASTER!$AT4,MASTER!$AZ4,MASTER!$BF4,MASTER!$BL4,MASTER!$BR4}
Really appreciate your time!
 
Upvote 0
You have missed the row number from the AH col
 
Upvote 0
Thanks FLUFF
That worked.

=LET(x,VSTACK(REVs),LOOKUP(2,1/(x<>""),x))

REVs is: {=Master!$F2,Master!$L2,Master!$R2,Master!$X2,Master!$AD2,Master!$AJ2,Master!$AP2,Master!$AV2,Master!$BB2}
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,990
Messages
6,122,625
Members
449,093
Latest member
catterz66

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