Rolling Min Max of Last 12 Months

csimarketing

New Member
Joined
Jun 18, 2019
Messages
14
Office Version
  1. 2019
Platform
  1. MacOS
Hello,

I am trying to get a rolling/dynamic formula that calculates the MIN and MAX of the most recent 12 months, but all of the threads I can find are not specific enough. Any help would be greatly appreciated!

MIN formula should return: 2
MAX formula should return: 84

MonthJan-20Feb-20Mar-20Apr-20May-20Jun-20Jul-20Aug-20Sep-20Oct-20Nov-20Dec-20Jan-21Feb-21Mar-21MIN Last 12 MonthsMAX Last 12 Months
QTY2045416778424665431234547813

Thank you!
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
8,402
Office Version
  1. 365
Platform
  1. Windows
Try:

=MINIFS($B$2:$P$2,$B$1:$P$1,">="&EOMONTH(TODAY(),-12)+1,$B$1:$P$1,"<"&EOMONTH(TODAY(),0)+1)

Same for max but MAXIFS.
 

csimarketing

New Member
Joined
Jun 18, 2019
Messages
14
Office Version
  1. 2019
Platform
  1. MacOS
=MINIFS($B$2:$P$2,$B$1:$P$1,">="&EOMONTH(TODAY(),-12
Hi Steve, the MAXIF formula works great!

However, the MINIF formula is still including Zeros as a min. Is there a way I can exclude Zero values or only values greater than Zero to be counted towards the MIN?

I should have mentioned that the data above is just a sample set, my actual data set does have some months with Zero as their value.
 

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
8,402
Office Version
  1. 365
Platform
  1. Windows
Sure just add that in:

=MINIFS($B$2:$P$2,$B$1:$P$1,">="&EOMONTH(TODAY(),-12)+1,$B$1:$P$1,"<"&EOMONTH(TODAY(),0)+1,$B$2:$P$2,">0")
 
Solution

csimarketing

New Member
Joined
Jun 18, 2019
Messages
14
Office Version
  1. 2019
Platform
  1. MacOS
These worked great, Thank you! You saved me hours of trial and error!
 

Watch MrExcel Video

Forum statistics

Threads
1,130,119
Messages
5,640,218
Members
417,131
Latest member
Seanr19871

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
Top