# Break Revenue Down By Month - Start End Date and Amount

#### footballdj123

##### New Member
Hello,

I have two dates and an amount field, I want to break the revenue into each month. I have a formula

=(IF(AND(\$B2>=D\$1,\$A2<=DATE(YEAR(D\$1),MONTH(D\$1)+1,0)),MIN(\$B2,DATE(YEAR(D\$1),MONTH(D\$1)+1,1))-MAX(\$A2,D\$1),0)/(\$B2-\$A2))*\$C2

It breaks down the revenue incorrectly across the months. I took the value and look at it daily and it was slightly off. The total amount does match up, just not how its weighted into each month.

Any idea why?

 Start Date End Date Amount 4/1/2018 5/1/2018 6/1/2018 7/1/2018 8/1/2018 9/1/2018 10/1/2018 11/1/2018 12/1/2018 1/1/2019 2/1/2019 3/1/2019 4/1/2019 5/1/2019 6/1/2019 7/1/2019 5/18/2018 6/15/2018 4250 \$0 \$2,125 \$2,125 \$0 \$0 \$0 \$0 \$0 \$0 \$0 \$0 \$0 \$0 \$0 \$0 \$0 11/19/2018 12/16/2018 0 \$0 \$0 \$0 \$0 \$0 \$0 \$0 \$0 \$0 \$0 \$0 \$0 \$0 \$0 \$0 \$0 1/14/2019 5/5/2019 25200 \$0 \$0 \$0 \$0 \$0 \$0 \$0 \$0 \$0 \$4,086 \$6,357 \$7,038 \$6,811 \$908 \$0 \$0 1/9/2019 2/17/2019 22500 \$0 \$0 \$0 \$0 \$0 \$0 \$0 \$0 \$0 \$13,269 \$9,231 \$0 \$0 \$0 \$0 \$0 1/9/2019 2/17/2019 22500 \$0 \$0 \$0 \$0 \$0 \$0 \$0 \$0 \$0 \$13,269 \$9,231 \$0 \$0 \$0 \$0 \$0 1/7/2019 12/30/2019 49800 \$0 \$0 \$0 \$0 \$0 \$0 \$0 \$0 \$0 \$3,487 \$3,906 \$4,324 \$4,185 \$4,324 \$4,185 \$4,324

<colgroup><col span="2"><col><col span="6"><col span="3"><col span="7"></colgroup><tbody>
</tbody>

### Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

#### Marcelo Branco

##### MrExcel MVP
Maybe...

=IF(AND(\$B2>=D\$1,\$A2<=DATE(YEAR(D\$1),MONTH(D\$1)+1,0)),MIN(\$B2,EOMONTH(D\$1,0))-MAX(\$A2,D\$1-1),0)*\$C2/(\$B2-\$A2)

M.

#### footballdj123

##### New Member
Thanks for trying Marcelo but still doesn't work. The months don't match up to if I do it daily.

1,102,665
Messages
5,488,177
Members
407,630
Latest member
Mehezabin

### This Week's Hot Topics

• Timer in VBA - Stop, Start, Pause and Reset
[CODE=vba][/CODE] Option Explicit Dim CmdStop As Boolean Dim Paused As Boolean Dim Start Dim TimerValue As Date Dim pausedTime As Date Sub...
• how to updates multiple rows in muliselect listbox
Hello everyone. I need help with below code. code is only chaning 1st row in mulitiselect list box. i know issue with code...
• Delete Row from Table
I am trying to delete a row from a table using VBA using a named range to find what I need to delete. My Range is finding the right cell. In the...
• Assigning to a variable
I have a for each block where I want to assign the value in column 5 of the found row to the variable Serv. [CODE=vba] For Each ws In...
• Way to verify information
Hi All, I don't know what to call this formula, and therefore can't search. I have a spreadsheet with information I want to reference...
• Active Cell Address – Inactive Sheet
How to use VBA to get the cell address of the active cell in an inactive worksheet and then place that cell address in a location on the current...