#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default SUMIF?

Here is my situation
I have a data range that contains a six-character value. I only care about
the last character

I want to sum the values in I4:I29 where the characters in A4:H29 meet a
certain value

EX: A4 = A00000A; I4 = 2
B10 = B11111A; I10=1
G5 = C12121A; I5 = 1
H29 = D12345A; I5 = 4

I want the sum of the values in I (8) for these cells but not for any others.

I have tried:
=IF(A4:H29=€*A€,SUM(I4:I29),0)
=SUMIF(A4:H29, €œ*A€, I4:I29)
=SUM(IF(((A4:A29=€*A€)+(B4:B29=€*A€)+(C4:C 29=€*A€)+
(D4:D29=€*A€)+(E4:E29=€*A€)+(F4:F29=€*A €) +(G4:G29=€*A€)), SUM(I4:I29),0)
=IF(RIGHT(A4:A29)="N",SUM(I4:I39),0)

All of the above formulas return the value 0 (false)

On the same worksheet the following formula works:
COUNTIF(A4:H29,€*A€)

Any suggestions?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default SUMIF?

If a row contains more than one entry that meets the criteria should that be
calculated as n*I ?

Like this:

xxxA...xxxc...cccA...5

The row contins 2 entries that end in "A". So, should the result add 2*5 =
10 to the total?

--
Biff
Microsoft Excel MVP


"Perry" wrote in message
...
Here is my situation
I have a data range that contains a six-character value. I only care about
the last character

I want to sum the values in I4:I29 where the characters in A4:H29 meet a
certain value

EX: A4 = A00000A; I4 = 2
B10 = B11111A; I10=1
G5 = C12121A; I5 = 1
H29 = D12345A; I5 = 4

I want the sum of the values in I (8) for these cells but not for any
others.

I have tried:
=IF(A4:H29="*A",SUM(I4:I29),0)
=SUMIF(A4:H29, "*A", I4:I29)
=SUM(IF(((A4:A29="*A")+(B4:B29="*A")+(C4:C29="*A") +
(D4:D29="*A")+(E4:E29="*A")+(F4:F29="*A") +(G4:G29="*A")), SUM(I4:I29),0)
=IF(RIGHT(A4:A29)="N",SUM(I4:I39),0)

All of the above formulas return the value 0 (false)

On the same worksheet the following formula works:
COUNTIF(A4:H29,"*A")

Any suggestions?



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,805
Default SUMIF?

Enter this in J4
=COUNTIF(A4:H4,"*A") and copy down till J29
Now in I30 enter
=SUMPRODUCT(--(J2:J290),I2:I29) to get what you want...

I could not think of a way to combine the above two formulae

--
If you find this post helpful pl. choose "Yes"...


"Perry" wrote:

Here is my situation
I have a data range that contains a six-character value. I only care about
the last character

I want to sum the values in I4:I29 where the characters in A4:H29 meet a
certain value

EX: A4 = A00000A; I4 = 2
B10 = B11111A; I10=1
G5 = C12121A; I5 = 1
H29 = D12345A; I5 = 4

I want the sum of the values in I (8) for these cells but not for any others.

I have tried:
=IF(A4:H29=€*A€,SUM(I4:I29),0)
=SUMIF(A4:H29, €œ*A€, I4:I29)
=SUM(IF(((A4:A29=€*A€)+(B4:B29=€*A€)+(C4:C 29=€*A€)+
(D4:D29=€*A€)+(E4:E29=€*A€)+(F4:F29=€*A €) +(G4:G29=€*A€)), SUM(I4:I29),0)
=IF(RIGHT(A4:A29)="N",SUM(I4:I39),0)

All of the above formulas return the value 0 (false)

On the same worksheet the following formula works:
COUNTIF(A4:H29,€*A€)

Any suggestions?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,344
Default SUMIF?

Hi,

First thing to note is that IF does not support wildcards.

If there are at most one match per row or you want to sum it more than once
if it appears a one row more than once you can use the single formula:

=SUMPRODUCT(NOT(ISERR(SEARCH("?????A",A1:H12)))*I1 :I12)

--
Thanks,
Shane Devenshire


"Sheeloo" wrote:

Enter this in J4
=COUNTIF(A4:H4,"*A") and copy down till J29
Now in I30 enter
=SUMPRODUCT(--(J2:J290),I2:I29) to get what you want...

I could not think of a way to combine the above two formulae

--
If you find this post helpful pl. choose "Yes"...


"Perry" wrote:

Here is my situation
I have a data range that contains a six-character value. I only care about
the last character

I want to sum the values in I4:I29 where the characters in A4:H29 meet a
certain value

EX: A4 = A00000A; I4 = 2
B10 = B11111A; I10=1
G5 = C12121A; I5 = 1
H29 = D12345A; I5 = 4

I want the sum of the values in I (8) for these cells but not for any others.

I have tried:
=IF(A4:H29=€*A€,SUM(I4:I29),0)
=SUMIF(A4:H29, €œ*A€, I4:I29)
=SUM(IF(((A4:A29=€*A€)+(B4:B29=€*A€)+(C4:C 29=€*A€)+
(D4:D29=€*A€)+(E4:E29=€*A€)+(F4:F29=€*A €) +(G4:G29=€*A€)), SUM(I4:I29),0)
=IF(RIGHT(A4:A29)="N",SUM(I4:I39),0)

All of the above formulas return the value 0 (false)

On the same worksheet the following formula works:
COUNTIF(A4:H29,€*A€)

Any suggestions?

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default SUMIF?

Just to add to Shane's response.

If there are multiple cells in a single row that match that criteria, then the
value in column I will be used for each match.



ShaneDevenshire wrote:

Hi,

First thing to note is that IF does not support wildcards.

If there are at most one match per row or you want to sum it more than once
if it appears a one row more than once you can use the single formula:

=SUMPRODUCT(NOT(ISERR(SEARCH("?????A",A1:H12)))*I1 :I12)

--
Thanks,
Shane Devenshire

"Sheeloo" wrote:

Enter this in J4
=COUNTIF(A4:H4,"*A") and copy down till J29
Now in I30 enter
=SUMPRODUCT(--(J2:J290),I2:I29) to get what you want...

I could not think of a way to combine the above two formulae

--
If you find this post helpful pl. choose "Yes"...


"Perry" wrote:

Here is my situation
I have a data range that contains a six-character value. I only care about
the last character

I want to sum the values in I4:I29 where the characters in A4:H29 meet a
certain value

EX: A4 = A00000A; I4 = 2
B10 = B11111A; I10=1
G5 = C12121A; I5 = 1
H29 = D12345A; I5 = 4

I want the sum of the values in I (8) for these cells but not for any others.

I have tried:
=IF(A4:H29=€*A€,SUM(I4:I29),0)
=SUMIF(A4:H29, €œ*A€, I4:I29)
=SUM(IF(((A4:A29=€*A€)+(B4:B29=€*A€)+(C4:C 29=€*A€)+
(D4:D29=€*A€)+(E4:E29=€*A€)+(F4:F29=€*A €) +(G4:G29=€*A€)), SUM(I4:I29),0)
=IF(RIGHT(A4:A29)="N",SUM(I4:I39),0)

All of the above formulas return the value 0 (false)

On the same worksheet the following formula works:
COUNTIF(A4:H29,€*A€)

Any suggestions?


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default SUMIF?

Thank you Shane and Dave. The SUMPRODUCT formula worked like a champ. I will
have to learn a bit more about this formula.
Perry Hill

"Dave Peterson" wrote:

Just to add to Shane's response.

If there are multiple cells in a single row that match that criteria, then the
value in column I will be used for each match.



ShaneDevenshire wrote:

Hi,

First thing to note is that IF does not support wildcards.

If there are at most one match per row or you want to sum it more than once
if it appears a one row more than once you can use the single formula:

=SUMPRODUCT(NOT(ISERR(SEARCH("?????A",A1:H12)))*I1 :I12)

--
Thanks,
Shane Devenshire

"Sheeloo" wrote:

Enter this in J4
=COUNTIF(A4:H4,"*A") and copy down till J29
Now in I30 enter
=SUMPRODUCT(--(J2:J290),I2:I29) to get what you want...

I could not think of a way to combine the above two formulae

--
If you find this post helpful pl. choose "Yes"...


"Perry" wrote:

Here is my situation
I have a data range that contains a six-character value. I only care about
the last character

I want to sum the values in I4:I29 where the characters in A4:H29 meet a
certain value

EX: A4 = A00000A; I4 = 2
B10 = B11111A; I10=1
G5 = C12121A; I5 = 1
H29 = D12345A; I5 = 4

I want the sum of the values in I (8) for these cells but not for any others.

I have tried:
=IF(A4:H29=รข‚ฌย*Aรข‚ฌย,SUM(I4:I29),0)
=SUMIF(A4:H29, รข‚ฌล“*Aรข‚ฌย, I4:I29)
=SUM(IF(((A4:A29=รข‚ฌย*Aรข‚ฌย)+(B4:B29=รข‚ฌย *Aรข‚ฌย)+(C4:C29=รข‚ฌย*Aรข‚ฌย)+
(D4:D29=รข‚ฌย*Aรข‚ฌย)+(E4:E29=รข‚ฌย*Aรข‚ฌย )+(F4:F29=รข‚ฌย*Aรข‚ฌย) +(G4:G29=รข‚ฌย*Aรข‚ฌย)), SUM(I4:I29),0)
=IF(RIGHT(A4:A29)="N",SUM(I4:I39),0)

All of the above formulas return the value 0 (false)

On the same worksheet the following formula works:
COUNTIF(A4:H29,รข‚ฌย*Aรข‚ฌย)

Any suggestions?


--

Dave Peterson

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default SUMIF?

A few keystrokes shorter:

=SUMPRODUCT((RIGHT(A4:H29)="A")*I4:I29)

--
Biff
Microsoft Excel MVP


"Perry" wrote in message
...
Thank you Shane and Dave. The SUMPRODUCT formula worked like a champ. I
will
have to learn a bit more about this formula.
Perry Hill

"Dave Peterson" wrote:

Just to add to Shane's response.

If there are multiple cells in a single row that match that criteria,
then the
value in column I will be used for each match.



ShaneDevenshire wrote:

Hi,

First thing to note is that IF does not support wildcards.

If there are at most one match per row or you want to sum it more than
once
if it appears a one row more than once you can use the single formula:

=SUMPRODUCT(NOT(ISERR(SEARCH("?????A",A1:H12)))*I1 :I12)

--
Thanks,
Shane Devenshire

"Sheeloo" wrote:

Enter this in J4
=COUNTIF(A4:H4,"*A") and copy down till J29
Now in I30 enter
=SUMPRODUCT(--(J2:J290),I2:I29) to get what you want...

I could not think of a way to combine the above two formulae

--
If you find this post helpful pl. choose "Yes"...


"Perry" wrote:

Here is my situation
I have a data range that contains a six-character value. I only
care about
the last character

I want to sum the values in I4:I29 where the characters in A4:H29
meet a
certain value

EX: A4 = A00000A; I4 = 2
B10 = B11111A; I10=1
G5 = C12121A; I5 = 1
H29 = D12345A; I5 = 4

I want the sum of the values in I (8) for these cells but not for
any others.

I have tried:
=IF(A4:H29=?*A?,SUM(I4:I29),0)
=SUMIF(A4:H29, ?o*A?, I4:I29)
=SUM(IF(((A4:A29=?*A?)+(B4:B29=?*A?)+(C4:C 29=?*A?)+
(D4:D29=?*A?)+(E4:E29=?*A?)+(F4:F29=?*A ?)
+(G4:G29=?*A?)), SUM(I4:I29),0)
=IF(RIGHT(A4:A29)="N",SUM(I4:I39),0)

All of the above formulas return the value 0 (false)

On the same worksheet the following formula works:
COUNTIF(A4:H29,?*A?)

Any suggestions?


--

Dave Peterson



  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default SUMIF?

Just as a topic of conversation, this is a single formula, although no
pretty, that will total each match only once per row:

=SUMPRODUCT((((RIGHT(A4:A29)="A")+(RIGHT(B4:B29)=" A")+(RIGHT(C4:C29)="A")+(RIGHT(D4:D29)="A")
+(RIGHT(E4:E29)="A")+(RIGHT(F4:F29)="A")+(RIGHT(G4 :G29)="A")+(RIGHT(H4:H29)="A"))0)*I4:I29)

--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Sheeloo" <="to" & CHAR(95) & "sheeloo" & CHAR(64) & "hotmail.com" wrote in
message ...
Enter this in J4
=COUNTIF(A4:H4,"*A") and copy down till J29
Now in I30 enter
=SUMPRODUCT(--(J2:J290),I2:I29) to get what you want...

I could not think of a way to combine the above two formulae

--
If you find this post helpful pl. choose "Yes"...


"Perry" wrote:

Here is my situation
I have a data range that contains a six-character value. I only care
about
the last character

I want to sum the values in I4:I29 where the characters in A4:H29 meet a
certain value

EX: A4 = A00000A; I4 = 2
B10 = B11111A; I10=1
G5 = C12121A; I5 = 1
H29 = D12345A; I5 = 4

I want the sum of the values in I (8) for these cells but not for any
others.

I have tried:
=IF(A4:H29="*A",SUM(I4:I29),0)
=SUMIF(A4:H29, "*A", I4:I29)
=SUM(IF(((A4:A29="*A")+(B4:B29="*A")+(C4:C29="*A") +
(D4:D29="*A")+(E4:E29="*A")+(F4:F29="*A") +(G4:G29="*A")), SUM(I4:I29),0)
=IF(RIGHT(A4:A29)="N",SUM(I4:I39),0)

All of the above formulas return the value 0 (false)

On the same worksheet the following formula works:
COUNTIF(A4:H29,"*A")

Any suggestions?



  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default SUMIF?

A few keystrokes shorter:

=SUMPRODUCT(--(MMULT(--(RIGHT(A4:H29)="A"),{1;1;1;1;1;1;1;1})0),I4:I29)

Drawback: range is limited to no more than 5461 rows

--
Biff
Microsoft Excel MVP


"RagDyer" wrote in message
...
Just as a topic of conversation, this is a single formula, although no
pretty, that will total each match only once per row:

=SUMPRODUCT((((RIGHT(A4:A29)="A")+(RIGHT(B4:B29)=" A")+(RIGHT(C4:C29)="A")+(RIGHT(D4:D29)="A")
+(RIGHT(E4:E29)="A")+(RIGHT(F4:F29)="A")+(RIGHT(G4 :G29)="A")+(RIGHT(H4:H29)="A"))0)*I4:I29)

--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Sheeloo" <="to" & CHAR(95) & "sheeloo" & CHAR(64) & "hotmail.com" wrote
in message ...
Enter this in J4
=COUNTIF(A4:H4,"*A") and copy down till J29
Now in I30 enter
=SUMPRODUCT(--(J2:J290),I2:I29) to get what you want...

I could not think of a way to combine the above two formulae

--
If you find this post helpful pl. choose "Yes"...


"Perry" wrote:

Here is my situation
I have a data range that contains a six-character value. I only care
about
the last character

I want to sum the values in I4:I29 where the characters in A4:H29 meet a
certain value

EX: A4 = A00000A; I4 = 2
B10 = B11111A; I10=1
G5 = C12121A; I5 = 1
H29 = D12345A; I5 = 4

I want the sum of the values in I (8) for these cells but not for any
others.

I have tried:
=IF(A4:H29="*A",SUM(I4:I29),0)
=SUMIF(A4:H29, "*A", I4:I29)
=SUM(IF(((A4:A29="*A")+(B4:B29="*A")+(C4:C29="*A") +
(D4:D29="*A")+(E4:E29="*A")+(F4:F29="*A") +(G4:G29="*A")),
SUM(I4:I29),0)
=IF(RIGHT(A4:A29)="N",SUM(I4:I39),0)

All of the above formulas return the value 0 (false)

On the same worksheet the following formula works:
COUNTIF(A4:H29,"*A")

Any suggestions?





  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default SUMIF?

Just a few?<bg
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"T. Valko" wrote in message
...
A few keystrokes shorter:

=SUMPRODUCT(--(MMULT(--(RIGHT(A4:H29)="A"),{1;1;1;1;1;1;1;1})0),I4:I29)

Drawback: range is limited to no more than 5461 rows

--
Biff
Microsoft Excel MVP


"RagDyer" wrote in message
...
Just as a topic of conversation, this is a single formula, although no
pretty, that will total each match only once per row:

=SUMPRODUCT((((RIGHT(A4:A29)="A")+(RIGHT(B4:B29)=" A")+(RIGHT(C4:C29)="A")+(RIGHT(D4:D29)="A")
+(RIGHT(E4:E29)="A")+(RIGHT(F4:F29)="A")+(RIGHT(G4 :G29)="A")+(RIGHT(H4:H29)="A"))0)*I4:I29)

--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Sheeloo" <="to" & CHAR(95) & "sheeloo" & CHAR(64) & "hotmail.com" wrote
in message ...
Enter this in J4
=COUNTIF(A4:H4,"*A") and copy down till J29
Now in I30 enter
=SUMPRODUCT(--(J2:J290),I2:I29) to get what you want...

I could not think of a way to combine the above two formulae

--
If you find this post helpful pl. choose "Yes"...


"Perry" wrote:

Here is my situation
I have a data range that contains a six-character value. I only care
about
the last character

I want to sum the values in I4:I29 where the characters in A4:H29 meet
a
certain value

EX: A4 = A00000A; I4 = 2
B10 = B11111A; I10=1
G5 = C12121A; I5 = 1
H29 = D12345A; I5 = 4

I want the sum of the values in I (8) for these cells but not for any
others.

I have tried:
=IF(A4:H29="*A",SUM(I4:I29),0)
=SUMIF(A4:H29, "*A", I4:I29)
=SUM(IF(((A4:A29="*A")+(B4:B29="*A")+(C4:C29="*A") +
(D4:D29="*A")+(E4:E29="*A")+(F4:F29="*A") +(G4:G29="*A")),
SUM(I4:I29),0)
=IF(RIGHT(A4:A29)="N",SUM(I4:I39),0)

All of the above formulas return the value 0 (false)

On the same worksheet the following formula works:
COUNTIF(A4:H29,"*A")

Any suggestions?







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SumIf Shams Excel Worksheet Functions 4 June 12th 08 08:40 AM
sumif for multi conditions. i.e sumif(A1:A10,"Jon" and B1:B10,"A" Harry Seymour Excel Worksheet Functions 9 June 12th 07 10:47 PM
Embedding a Sumif in a sumif C.Pflugrath Excel Worksheet Functions 5 August 31st 05 07:31 PM
nested sumif or sumif with two criteria dshigley Excel Worksheet Functions 5 April 5th 05 03:34 AM
SUMIF - Range name to used for the "sum_range" portion of a SUMIF function Oscar Excel Worksheet Functions 2 January 11th 05 11:01 PM


All times are GMT +1. The time now is 07:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ฉ2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"