0
votes

This is a sample value for my Excel file.

AA | 1 | 2 | 3
BB | 2 | 3 | 1
CC | 3 | 5 | 4

When I choose AA using the SUMIF() function, it only returns the first value. How do I get the sum of a whole row based on the selected cell in a column?

AA | 6
BB | 6
CC | 12

EDIT: Output for AA change to 6 (typo)

This is the formula that I am using:

=SUMIF($A$2:A4, B1, $B$2:$D$2)
2
Post the formula that you tried with pleaseRobin Mackenzie
Can you post the formula you are using. How are you "selecting a cell"?nightcrawler23
@pnuts That was my mistake. Corrected!Daniel Valle
Updated. Formula included.Daniel Valle

2 Answers

0
votes

Assuming AA is in A1 (and also in A6) then in B6 and copied down to suit:

=SUM(1:1)
0
votes

Solved.

Instead of using SUMIF(), I used SUMPRODUCT().

= SUMPRODUCT(($A$2:$A$4=B1) * $B$2:$D$4)