Calorie Counter Spreadsheet v2
Apr 14 2026
After taking the Calorie Counter XLS spreadsheet I found and fixing the formulas for Apple Numbers I then made a few changes.
For Weekly and Monthly I wanted Calories per Day. The formula for Weekly Calories per Day:
For Entries::Table 1::G, I created a column WeekDateKey
Which will return, for example, 2026-W13-2026-03-26. Since each day has several entries, one for each meal, there will be several lines with 2026-W13-2026-03-26.
Then returns something like 2026-W13.
Now Filter only returns lines that match the Week (YYYY-WW) column. There will be several lines each for 2026-W13-2026-03-26, 2026-W13-2026-03-27, 2026-W13-2026-03-28 and so on.
Filters out the duplicates so now we have one line per day.
Just counts the number of lines which is the number of days in the week.
----------------
Now, we could have just used a static 7 since every week except the first and last will have seven days in the spreadsheet. But the same principle applies to Monthly Calories per Day.
Although here we can use the Daily Totals Date column for the filtering.
Once again though maybe using static numbers instead of calculating for the month days. We could use a table since the number of days varies.
But static numbers presume we record every day which we might not so I guess calculating both days in week and days in month is still a good idea.
Calorie Counter v2 (2026-04-06)
For Weekly and Monthly I wanted Calories per Day. The formula for Weekly Calories per Day:
IF (D3="", "", E3 ÷ COUNTA (UNIQUE (FILTER (Entries::Table 1::G, LEFT(Entries::Table 1::G, 8) = D3))))For Entries::Table 1::G, I created a column WeekDateKey
IF(ISBLANK(A2),"",CONCATENATE(E2,"-",A2))Which will return, for example, 2026-W13-2026-03-26. Since each day has several entries, one for each meal, there will be several lines with 2026-W13-2026-03-26.
LEFT(Entries::Table 1::G, 8) Then returns something like 2026-W13.
FILTER (Entries::Table 1::G, LEFT(Entries::Table 1::G, 8) = D3)Now Filter only returns lines that match the Week (YYYY-WW) column. There will be several lines each for 2026-W13-2026-03-26, 2026-W13-2026-03-27, 2026-W13-2026-03-28 and so on.
UNIQUEFilters out the duplicates so now we have one line per day.
COUNTAJust counts the number of lines which is the number of days in the week.
----------------
Now, we could have just used a static 7 since every week except the first and last will have seven days in the spreadsheet. But the same principle applies to Monthly Calories per Day.
IF(H3="","",I3÷COUNTA(FILTER(A,LEFT(A,7)=H3)))Although here we can use the Daily Totals Date column for the filtering.
Once again though maybe using static numbers instead of calculating for the month days. We could use a table since the number of days varies.
But static numbers presume we record every day which we might not so I guess calculating both days in week and days in month is still a good idea.
Calorie Counter v2 (2026-04-06)