Reputation: 79
I have an excel file with two columns: A is a date and B is the amount. I want to calculate how much did i make per day.
I have tried different codes i found online but they didn't work,
Such as:
My Data ex:
1/12/2015
1/12/2015
1/12/2015 -45.28
1/12/2015
1/12/2015 146.23
1/12/2015 -95.03
1/12/2015
1/12/2015
1/12/2015 76.91
1/12/2015
1/12/2015
1/12/2015
2/12/2015
2/12/2015 155.42
2/12/2015 102.18
My Funcation:
=IF(ROUND((CELL("row",A4)/4),0)=(CELL("row",A4)/4),SUM(A1:OFFSET(A4,0,0)),"")
Can you please help me with finding the code i need?
Thank you.
Upvotes: 0
Views: 84
Reputation: 60174
You can also just use a pivot table. Drag dates to the Rows area, and Amounts to the Values area. Set the Value field settings to Sum
, and format to taste:
Upvotes: 1
Reputation: 18642
Use one of the techniques in [this](http://www.get-digital-help.com/2009/03/30/how-to-extract-a-unique-list-and-the-duplicates-in-excel-from-one-column/ to first create a unique list) page to create a unique list of dates. Use the SUMIF Function to find the sum matching each unique date.
You can also use cell references that define the date range criteria. For example, if you enter the date 1/31/2013 in cell D1, all cells between B2 and B32 are summed:
=SUMIF(A2:A32,"="&D1,B2:B32)
Upvotes: 1