ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Sumif over multiple columns (https://www.excelbanter.com/excel-worksheet-functions/13210-sumif-over-multiple-columns.html)

Josh O.

Sumif over multiple columns
 
I am trying to total some columns based on an invoice number, but I can't get
the formula to work.
I have the following columns:
Invoice 1|Amount1|Invoice2|Amount2|Invoice3|Amount3|Invoic e4|Amount4

In another column I have an invoice number. I need the formula to add the
amount if the invoice column just to the left contains that invoice number,
for each column.

For example in A1 is invoice 1234. I need the formula to add all amounts
from Columns Amount1, Amount2, Amount3, Amount4 if the corresponding Invoice
column matches A1.

I tried using the Sumif and Sumproduct, but it is only returning a #VALUE!
error.

JulieD

Hi Josh

one option
=SUMIF(A2:A5,J1,B2:B5)+SUMIF(C2:C5,J1,D2:D5)+SUMIF (E2:E5,J1,F2:F5)+SUMIF(G2:G5,J1,H2:H5)

(i've put the criteria in J1)

Cheers
JulieD

"Josh O." wrote in message
...
I am trying to total some columns based on an invoice number, but I can't
get
the formula to work.
I have the following columns:
Invoice 1|Amount1|Invoice2|Amount2|Invoice3|Amount3|Invoic e4|Amount4

In another column I have an invoice number. I need the formula to add the
amount if the invoice column just to the left contains that invoice
number,
for each column.

For example in A1 is invoice 1234. I need the formula to add all amounts
from Columns Amount1, Amount2, Amount3, Amount4 if the corresponding
Invoice
column matches A1.

I tried using the Sumif and Sumproduct, but it is only returning a #VALUE!
error.





All times are GMT +1. The time now is 06:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com