0
votes

What formula would I use to do a sum of the contents of a range of cells, provided that the contents of an adjacent cell equal another cell.

The example I could give is, if I have a set of invoices which quote a purchase order, I want to see the sum of the invoices for that given purchase order, I have included a link to an excel spreadsheet where I have tried two different formulas but can't seem to get to grips with what I need to do. The formulas are in Column J.

https://www.dropbox.com/s/xw9aun1cblro9ix/Test.xlsx?dl=0

1
=SUMIF(C2:C4;H2;B2:B4)user3819867
That's brilliant thank you, there was a mistake in your formula, but I replaced the ";" with a "," and it worked. how do I set your answer as the answer to this?AlexGadd
@user3819867 thanks for thatAlexGadd
@pnuts it doesn't seem to work, I'll read up on how to laterAlexGadd
@pnuts I agree, annoyingly most people don't post their comments as an answer and so don't give me a chance to mark them as having answered my questionAlexGadd

1 Answers

1
votes

You'd better lock the references to use absolute column references like this:
put this formula in J and copy down:

=SUMIF($C$2:$C$4,$H2,$B$2:$B$4)


by add the $ sign to the column refs.