Find today's date then look at the 5 days prior to find the maximum value

suprsnipes

Active Member
Joined
Apr 26, 2009
Messages
434
Hi,

I need help with the following formula.

If the cell reference B6 to B92 is equal to today's date I want to find the maximum value in column G for the 5 days prior, so let's say cell B54 is today's date I want to find the maximum value from the 5 days prior which is 5 cells from B53 to B49. How could I do that?

Regards,
suprsnipes
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Can you give us a worked example please ?

I know what you mean by referring to 5 days prior, and I know what you mean by finding the maximum value, but I'm not clear what you want when you talk about both of them at the same time.
 
Upvote 0
I would like a formula that can look at column B from rows 6 to 92. When the formula finds that the date in column B matches today's date, today() then look at the equivalent row in column G and find the maximum value over the previous 5 rows of data.
 
Upvote 0
Try this

=MAX(OFFSET(INDEX(G6:G92,MATCH(TODAY(),B6:B92,0)),,,-5))
 
Upvote 0
Sorry, mis-read it. I think you need

=MAX(OFFSET(INDEX(G6:G92,MATCH(TODAY(),B6:B92,0)-1),,,-5))


Also, what should happen if today's date is in the top few cells of the column B range so there isn't 5 previous days?
 
Upvote 0

Forum statistics

Threads
1,224,542
Messages
6,179,424
Members
452,914
Latest member
echoix

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