Question

I have an excel question that i was not able to figure out, i'm sorry to say but my experience with Excel is limited to cell filling and maybe a couple of graphs and functions. I'm now facing a task on which i have to nest some formulas ...

I have a column with names, that will repeat over time. I want to be able to lookup through that column, and when it comes across a name, for example "David", to add the values that are on that row.

In the below example, David would have : 3+4+5 + 2+0+4 adding to a total of 18.

David   3   4   5
Bob     1   2   3
David   2   0   4

    David =     

I tried something with LOOKUP function but it's far from what i need :

=IF(LOOKUP("David";B1:B7);SUM(C4:E4);0)

Thanks for your help !

Was it helpful?

Solution

Consider:

=SUMPRODUCT((B1:B7="david")*(C1:C7))+SUMPRODUCT((B1:B7="david")*(D1:D7))+SUMPRODUCT((B1:B7="david")*(E1:E7))

OTHER TIPS

Lets say your data is in this format:

enter image description here

Put this in column E:

=SUM(B1:D1)

and put this in cell B6:

=VLOOKUP(B5, A1:E3, 5, FALSE)

If you change the value in cell B5 your value in cell B6 will update:

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top