ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Sumif with conditions (https://www.excelbanter.com/excel-worksheet-functions/178617-sumif-conditions.html)

soconfused

Sumif with conditions
 
I am trying do do a sumif using 2 conditions

For example:

I want to add the values in column d if the value in column a is either C or
X.
--
DMM

T. Valko

Sumif with conditions
 
One way:

=SUM(SUMIF(A1:A10,{"C","X"},D1:D10))


--
Biff
Microsoft Excel MVP


"soconfused" wrote in message
...
I am trying do do a sumif using 2 conditions

For example:

I want to add the values in column d if the value in column a is either C
or
X.
--
DMM




soconfused

Sumif with conditions
 
This didn't work, it gave me 0 for the answer.
--
DMM


"T. Valko" wrote:

One way:

=SUM(SUMIF(A1:A10,{"C","X"},D1:D10))


--
Biff
Microsoft Excel MVP


"soconfused" wrote in message
...
I am trying do do a sumif using 2 conditions

For example:

I want to add the values in column d if the value in column a is either C
or
X.
--
DMM





Gord Dibben

Sumif with conditions
 
Are the numbers in column D actually numbers?

In E1 enter =ISNUMBER(D1) and copy down.

TRUE or FALSE returned?

If FALSE, format all to General. Copy an empty cell and Paste
SpecialAddOKEsc.


Gord Dibben MS Excel MVP

On Tue, 4 Mar 2008 05:20:00 -0800, soconfused
wrote:

This didn't work, it gave me 0 for the answer.



T. Valko

Sumif with conditions
 
It should work. See this screencap:

http://img118.imageshack.us/img118/9061/sumsumifkx2.jpg

If you're getting a result of 0 then there's a problem with your data. The
numbers may be numbers formatted as TEXT or there may be unseen charactes
in column A like leading/trailing spaces.

Try this first:

Select an empty cell that hasn't been formatted or used in any way.
Copy that empty cell: EditCopy
Select the range of numbers in column D.
Then, EditPaste SpecialAddOK

Does the formula now work?


--
Biff
Microsoft Excel MVP


"soconfused" wrote in message
...
This didn't work, it gave me 0 for the answer.
--
DMM


"T. Valko" wrote:

One way:

=SUM(SUMIF(A1:A10,{"C","X"},D1:D10))


--
Biff
Microsoft Excel MVP


"soconfused" wrote in message
...
I am trying do do a sumif using 2 conditions

For example:

I want to add the values in column d if the value in column a is either
C
or
X.
--
DMM







soconfused

Sumif with conditions
 
Thank you so much, it was the leading/trailing spaces.
--
DMM


"T. Valko" wrote:

It should work. See this screencap:

http://img118.imageshack.us/img118/9061/sumsumifkx2.jpg

If you're getting a result of 0 then there's a problem with your data. The
numbers may be numbers formatted as TEXT or there may be unseen charactes
in column A like leading/trailing spaces.

Try this first:

Select an empty cell that hasn't been formatted or used in any way.
Copy that empty cell: EditCopy
Select the range of numbers in column D.
Then, EditPaste SpecialAddOK

Does the formula now work?


--
Biff
Microsoft Excel MVP


"soconfused" wrote in message
...
This didn't work, it gave me 0 for the answer.
--
DMM


"T. Valko" wrote:

One way:

=SUM(SUMIF(A1:A10,{"C","X"},D1:D10))


--
Biff
Microsoft Excel MVP


"soconfused" wrote in message
...
I am trying do do a sumif using 2 conditions

For example:

I want to add the values in column d if the value in column a is either
C
or
X.
--
DMM







T. Valko

Sumif with conditions
 
Glad you got it straightened out. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"soconfused" wrote in message
...
Thank you so much, it was the leading/trailing spaces.
--
DMM


"T. Valko" wrote:

It should work. See this screencap:

http://img118.imageshack.us/img118/9061/sumsumifkx2.jpg

If you're getting a result of 0 then there's a problem with your data.
The
numbers may be numbers formatted as TEXT or there may be unseen
charactes
in column A like leading/trailing spaces.

Try this first:

Select an empty cell that hasn't been formatted or used in any way.
Copy that empty cell: EditCopy
Select the range of numbers in column D.
Then, EditPaste SpecialAddOK

Does the formula now work?


--
Biff
Microsoft Excel MVP


"soconfused" wrote in message
...
This didn't work, it gave me 0 for the answer.
--
DMM


"T. Valko" wrote:

One way:

=SUM(SUMIF(A1:A10,{"C","X"},D1:D10))


--
Biff
Microsoft Excel MVP


"soconfused" wrote in message
...
I am trying do do a sumif using 2 conditions

For example:

I want to add the values in column d if the value in column a is
either
C
or
X.
--
DMM










All times are GMT +1. The time now is 03:58 PM.

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