The first row has numbers with multiple entries of each number, and the second row has numbers that needs to be added for each of the corresponding entry in column 1. For example: the total for 1
from column A will be 370 after adding the first four cells from column B because they correspond to 1
from column A. This is a just a sample. I have a dataset that has a thousand numbers like this. There is no way I will be able to filter each number one by one and sum the numbers in the second column.
Could someone tell me how to do it ?
A PivotTable would seem ideal:
in part because it automatically extracts uniques for the A
values - and even sorts them!
Be sure to label your columns.
Alternatives include SUMIF and SUMIFS. For example with SUMIF (OP's preference) with 1
, 2
, 3
and 4
in say D9 to D12 respectively, then in E9 and copied down to E12:
=SUMIF(A:A,D9,B:B)