Formula to lookup last day of a month and return the value next to it (Max + If function?)

Mr Retirement

New Member
Joined
Nov 12, 2016
Messages
46
Hi Everyone -

This might be explained easiest by the sample table below. I'm looking for a formula that will take my inputs (Month & Year) and return the value from the last available date in that month/year from the table.

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]Month:
[/TD]
[TD]3
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Year:
[/TD]
[TD]2013
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]NEEDED FORMULA:
[/TD]
[TD]1563
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Data:
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Helper Column (if needed)
[/TD]
[TD]Date
[/TD]
[TD]Value
[/TD]
[/TR]
[TR]
[TD]03201301
[/TD]
[TD]3/1/2013
[/TD]
[TD]1500
[/TD]
[/TR]
[TR]
[TD]03201304
[/TD]
[TD]3/4/2013
[/TD]
[TD]1502
[/TD]
[/TR]
[TR]
[TD]03201315
[/TD]
[TD]3/15/2013
[/TD]
[TD]1505
[/TD]
[/TR]
[TR]
[TD]03201328
[/TD]
[TD]3/28/2013
[/TD]
[TD]1563
[/TD]
[/TR]
[TR]
[TD]04201303
[/TD]
[TD]4/3/2013
[/TD]
[TD]1600
[/TD]
[/TR]
[TR]
[TD]etc...
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Any help would be appreciated :)

Thanks,
Mr R.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

Excel 2010
ABCD
1Month:3
2Year:2013
3NEEDED FORMULA:15631563
4
5
6Data:
7Helper Column (if needed)DateValue
832013013/1/20131500
932013043/4/20131502
1032013153/15/20131505
1132013283/28/20131563
1242013034/3/20131600
Sheet2
Cell Formulas
RangeFormula
D3=LOOKUP(2,1/(MONTH($B$8:$B$12)=C1),$C$8:$C$12)


=LOOKUP(2,1/IF(MONTH($B$8:$B$13)=C1,IF(YEAR($B$8:$B$13)=C2,1)),$C$8:$C$13) ctrl-shift-enter if you want different years
 
Last edited:
Upvote 0
This is actually better:


Excel 2010
BCD
1Month:3
2Year:2013
3NEEDED FORMULA:15631563
4
5
6
7DateValue
83/1/20131500
93/4/20131502
103/15/20131505
113/28/20131563
124/3/20131600
133/4/20141622
Sheet2
Cell Formulas
RangeFormula
D3=LOOKUP(2,1/(TEXT($B$8:$B$13,"myyyy")=C1&C2),$C$8:$C$13)
 
Upvote 0

Forum statistics

Threads
1,225,747
Messages
6,186,792
Members
453,371
Latest member
HMX180

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