# MAX/MIN to calculate depending on date range

#### Eyeope

##### New Member

I have a spreadsheet where I divide revenue depending on the start and end date, and it will divide revenue by the number of days of the order (from COLUMN S TO COLUMN JO).

It gets very heavy once I have 10,000+ orders and 750+ days.

Is there a way to structure it by month instead, so instead of Column S being 2016-11-01, Column S would be November, and Column T would be December etc.

I've attached my spreadsheet with my logic and formula: =MAX(0,MIN(S\$3,\$O4)-MAX(S\$3,\$N4)+1)*\$K4/\$P4

Many Thanks,

Eyeope

### Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Replies
3
Views
2K
Replies
4
Views
323
Replies
3
Views
932
Replies
1
Views
1K
Replies
3
Views
260

1,191,686
Messages
5,988,067
Members
440,125
Latest member
vincentchu2369

### 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.

### Which adblocker are you using?

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

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