Tracking medication usage, body part, pain level, and monthly totals on Numbers app

I have the beginning of a table that I have been tracking the usage of some medications and on the body part. I need to carry it a bit further than where I am at. It occurred to me that I should track each line entry as to Arm or Hand as well as the pain level of 1-5 at that time. To finish it of I would like to have a table of monthly totals for the use of each of the Meds to furnish my doctor.



[Edited by Moderator]

OT: Table construction help


MacBook Air 13″, macOS 15.5

Posted on Jul 28, 2025 7:41 PM

Reply
Question marked as Top-ranking reply

Posted on Jul 29, 2025 5:35 AM

First thing is to put a date on every line that has a time. You can continue with it as two separate columns but it might be less hassle to use one column that has the date and time in it like 07/07/25 6:36AM. If you type just the time, it will be given today's date without having to type it. Once all data rows have a date, you can use SUMIFS to sum them by month in your other table (see below).


If you used the first table only for data and there were no "total" rows, you could make a pivot table instead of using SUMIIFS. Maybe you can do it with the "total" rows there. SGIII might help with this. I don't do pivot tables very often but it would save you from a whole lot of formulas.


Here is an old-school SUMIFS version:


Formulas in the lower table:

B2 =MONTH(A)

C2 =YEAR(A)


D2 =COUNTIFS('Shoulder-Arm Pain Control'::B,"arm",'Shoulder-Arm Pain Control'::$A,">="&DATE($C,$B,1),'Shoulder-Arm Pain Control'::$A,"<="&EOMONTH(DATE($C,$B,1),0))

E2 = copy/paste the formula from D2 into E2 and change "arm" to "hand"


F2 =AVERAGEIFS('Shoulder-Arm Pain Control'::C,'Shoulder-Arm Pain Control'::$A,">="&DATE($C,$B,1),'Shoulder-Arm Pain Control'::$A,"<="&EOMONTH(DATE($C,$B,1),0))


Fiull right with the formula from F2 into G2 and change AVERAGEIFS to SUMIFS so it is

=SUMIFS('Shoulder-Arm Pain Control'::D,'Shoulder-Arm Pain Control'::$A,">="&DATE($C,$B,1),'Shoulder-Arm Pain Control'::$A,"<="&EOMONTH(DATE($C,$B,1),0))


Fill right from G2 to do put the SUMIF formulas into H2 and I2


If you have a version earlier than 14.4, you will have to fill down with all those formulas. With 14.4 they will "spill" down into the rest of the rows.


You can hide the month and year columns.


Error triangles in the average column are from having no data for those months. You can put IFERROR around the formula to turn it into something else or you can put a filter on the table to hide those rows or you can simply not have those rows until there is data for them.

4 replies
Question marked as Top-ranking reply

Jul 29, 2025 5:35 AM in response to dtryon9981

First thing is to put a date on every line that has a time. You can continue with it as two separate columns but it might be less hassle to use one column that has the date and time in it like 07/07/25 6:36AM. If you type just the time, it will be given today's date without having to type it. Once all data rows have a date, you can use SUMIFS to sum them by month in your other table (see below).


If you used the first table only for data and there were no "total" rows, you could make a pivot table instead of using SUMIIFS. Maybe you can do it with the "total" rows there. SGIII might help with this. I don't do pivot tables very often but it would save you from a whole lot of formulas.


Here is an old-school SUMIFS version:


Formulas in the lower table:

B2 =MONTH(A)

C2 =YEAR(A)


D2 =COUNTIFS('Shoulder-Arm Pain Control'::B,"arm",'Shoulder-Arm Pain Control'::$A,">="&DATE($C,$B,1),'Shoulder-Arm Pain Control'::$A,"<="&EOMONTH(DATE($C,$B,1),0))

E2 = copy/paste the formula from D2 into E2 and change "arm" to "hand"


F2 =AVERAGEIFS('Shoulder-Arm Pain Control'::C,'Shoulder-Arm Pain Control'::$A,">="&DATE($C,$B,1),'Shoulder-Arm Pain Control'::$A,"<="&EOMONTH(DATE($C,$B,1),0))


Fiull right with the formula from F2 into G2 and change AVERAGEIFS to SUMIFS so it is

=SUMIFS('Shoulder-Arm Pain Control'::D,'Shoulder-Arm Pain Control'::$A,">="&DATE($C,$B,1),'Shoulder-Arm Pain Control'::$A,"<="&EOMONTH(DATE($C,$B,1),0))


Fill right from G2 to do put the SUMIF formulas into H2 and I2


If you have a version earlier than 14.4, you will have to fill down with all those formulas. With 14.4 they will "spill" down into the rest of the rows.


You can hide the month and year columns.


Error triangles in the average column are from having no data for those months. You can put IFERROR around the formula to turn it into something else or you can put a filter on the table to hide those rows or you can simply not have those rows until there is data for them.

Aug 2, 2025 6:35 PM in response to dtryon9981

If you arrange your data in a format something like this, then a Data Table (or multiple data tables) can easily tally by month:






Click in table with data, choose from menu Organize > Create Pivot Table > On Current sheet and in the Pivot Option pane that appears simply drag the fields down into the boxes. Don't be afraid to experiment by dragging in different ways until you get what you want. Your original data will not be affected.


Intro to pivot tables in Numbers on Mac - Apple Support

Add and arrange pivot table data in Numbers on Mac - Apple Support


SG



This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Tracking medication usage, body part, pain level, and monthly totals on Numbers app

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.