Return Last Value in Range Using INDEX MATCH

brandonej

New Member
Joined
Aug 16, 2024
Messages
10
Office Version
  1. 365
Platform
  1. Windows
Hello all. I'm trying to create a lookup formula using INDEX MATCH that returns the last value in a range. It usually returns the first value that satisfies the lookup criteria (I think).

I need to find the ending balance of each week, and summarize those values in a table. (See image).

The formula I used in an attempt to return the ending balance for week 1 is: =INDEX($C$5:$W$5,MATCH(C9,$C$3:$W$3,0))
 

Attachments

  • Return Last Value in Range Using INDEX MATCH 2.png
    Return Last Value in Range Using INDEX MATCH 2.png
    44.8 KB · Views: 5

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Since you have MS365 you can use XMatch
Excel Formula:
=INDEX($C$5:$W$5,XMATCH(C$9,$C$3:$W$3,0,-1))

Alternatively you could swap to XLookup
Excel Formula:
=XLOOKUP(C$9,$C$3:$W$3,$C$5:$W$5,"",0,-1)

The "-1" at the end is the Search Mode with -1 being Search Last-to-First.
 
Last edited:
Upvote 1
Solution
Since you have MS365 you can use XMatch
Excel Formula:
=INDEX($C$5:$W$5,XMATCH(C$9,$C$3:$W$3,0,-1))

Alternatively you could swap to XLookup
Excel Formula:
=XLOOKUP(C$9,$C$3:$W$3,$C$5:$W$5,"",0,-1)

The "-1" at the end is the Search Mode with -1 being Search Last-to-First.
That did it. Thank you!!
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,173
Members
451,543
Latest member
cesymcox

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