Formula to pull most recent month where there is data

kac1125

Board Regular
Joined
Jul 31, 2014
Messages
74
Office Version
  1. 365
Platform
  1. Windows
Hello, I have the following data A;H:
ItemSum of 2/1/2020Sum of 3/1/2020Sum of 4/1/2020Sum of 5/1/2020Sum of 6/1/2020Sum of 7/1/2020Sum of 8/1/2020
A
45​
33​
175​
22​
56​
What i want for Column I is for the formula to tell me what the most recent month with data is. For this example I am looking for I to be Sum of 7/1/2020.
Thank you in advance.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
what version of excel do you have? We cannot tell where column I is? is 8/2/2020 Column H?
 
Upvote 0
what version of excel do you have? We cannot tell where column I is? is 8/2/2020 Column H?
ABCDEFGHI
Item
Sum of 2/1/2020
Sum of 3/1/2020
Sum of 4/1/2020
Sum of 5/1/2020
Sum of 6/1/2020
Sum of 7/1/2020
Sum of 8/1/2020
Last Month with data
A45331752256
Sorry for the confusion. I do not have the access to add the add in to my computer. I am on Office 365. So for column I (Last month with Data) for Item A. I am looking for it to report back sum of 7/1/2020 since this is the last month we see data entered. Hope this helps, and thanks again!
 
Upvote 0
Try
Excel Formula:
=LOOKUP(2,1/(B2:H2<>""),B2:H2)
Thank you! This worked to get the value of 56, is there a way for it to report back the header month instead? so instead of 56 it would say Sum of 7/1/2020?
 
Upvote 0
Excel Formula:
=INDEX(A1:H1,MAX(IF(A2:H2<>"",COLUMN(A2:H2))))
After you enter the formula instead of typing ENTER, type CTRL+SHIFT+ENTER
 
Upvote 0
I feel kinda silly. Get so caught up in the new formulas you forget about the old tricks.

I guess the one advantage of this would be that you would still get the correct answer even if the dates weren't in order. But this is overengineered for sure.

Excel Formula:
=LET(
    tbl,B2:H3,
    fx,LAMBDA(x,FILTER(x,INDEX(tbl,2,0)<>"")),
    df,fx(MAP(
        INDEX(tbl,1,0),
            LAMBDA(x,
                DATEVALUE(TAKE(TEXTSPLIT(x," "),,-1))
            )
        )),
    INDEX(fx(tbl),1,XMATCH(MAX(df),df,0))
)
 
Upvote 0
I am on Office 365

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’)

As you have 365 you could also use
Excel Formula:
=TAKE(FILTER($A$1:$H$1,A2:H2<>""),,-1)
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,959
Members
449,096
Latest member
Anshu121

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