Total of Multiple Entries Per Day

NoDayButToday

New Member
Joined
Feb 19, 2024
Messages
4
Office Version
  1. 2019
Platform
  1. Windows
I have a daily food log that shows calories consumed by meal for each day of a 2 year period, but the log doesn't have the total number of calories per day. I'd like to calculate the total number of calories for each specific day during that 2 year period. And, ultimately, I want to determine the average number of calories per day for that same time period.

Calorie Log (2014-2015).jpg
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
toi get a unique set of dates - as 2019 does not have UNIQUE() according to MS reference site
then use

=IFERROR(INDEX($A$2:$A$29, MATCH(0, COUNTIF($D1:D$1, $A$2:$A$29), 0)),"")
and then
=SUMIF($A$2:$A$6,$D2,$B$2:$B$6)

=IFERROR(AVERAGEIF($A$2:$A$17,D2,$B$2:$B$17),"")

if that works, use the exact range to avoid the zero - and can be cleaned up a bit

looks like its a TABLE

Book1
ABCDEF
1DATESSUMAVERAGE
21/1/1511/1/15155
31/1/1522/2/153316.5
41/1/15121/0/000 
52/2/1514 0 
62/2/1519 0 
7 0 
8 0 
9 0 
10 0 
11 
Sheet1
Cell Formulas
RangeFormula
E2:E10E2=SUMIF($A$2:$A$6,$D2,$B$2:$B$6)
F2:F10F2=IFERROR(AVERAGEIF($A$2:$A$17,D2,$B$2:$B$17),"")
D2D2=IFERROR(INDEX($A$2:$A$29, MATCH(0, COUNTIF($D1:D$1, $A$2:$A$29), 0)),"")
D3:D11D3=IFERROR(INDEX($A$2:$A$29, MATCH(0, COUNTIF($D$1:D2, $A$2:$A$29), 0)),"")
 
Upvote 0
Solution
Thank you! I was on the right track, but the IFERROR/INDEX formula you had in D2 was where I was messing up. Once I typed your formula in, it all came together.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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