Sum values in column Y if the values in column X are the same

Maikevr

New Member
Joined
Dec 20, 2018
Messages
4
I'm working on a nutritional project and I want to determine the average KiloJoule intake per week out of a large food intake survey. Therefore, I want to sum the values of K for each person entry (column A). For example, I want to sum I for rows 2:5 as these are the different ingredients that one unique person ate. I sum these values in column Q, so I can eventually calculate the average KiloJoule intake per meal. This is way to much work to do manually, how can I compute the sum of values of K separately for all unique person entries in column A?

Thanks in advance!

nl.tinypic.com
[/URL][/IMG]
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
try the =sumif(), sumifs() functions
 
Upvote 0
you shouldn't if you use Col A (id) as your criteria for the sumif()

eg, to get the answer of 1956 in Q163,

=SUMIF(A:A,A9,K:K)
 
Upvote 0
or you can tidy them up with this in Q2, and copy down

=IF(AND(A2<>A1,A2=A3),SUMIF(A:A,A2,K:K),"")
 
Upvote 0
you shouldn't if you use Col A (id) as your criteria for the sumif()

eg, to get the answer of 1956 in Q163,

=SUMIF(A:A,A9,K:K)

Thank you, I see that that works, but the point is that I want to get all of my Q values simultaneously instead of computing each one individually. I expect that column to get more than 100 entries.
 
Upvote 0
Thank you, I see that that works, but the point is that I want to get all of my Q values simultaneously instead of computing each one individually. I expect that column to get more than 100 entries.

have to tried the suggestion in post#5?
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,260
Members
452,627
Latest member
KitkatToby

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