ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   SumIf help (https://www.excelbanter.com/excel-worksheet-functions/181935-sumif-help.html)

Brad E.

SumIf help
 
Column A contains 5-digit codes. The third digit is a distance code, and I
want to sum entries in column C if the third digit is 4, 5 or 6. The only
other codes for the third digit are 1, 2 and 3, so I can use "3" since there
won't be anything over 6.

=SUMIF(MID(A1:A100,3,1),"3",C1:C100) isn't working for me.

Thank you, Brad

Bernard Liengme

SumIf help
 
=SUMPRODUCT(--(MID(A1:A100,3,1)3),C1:C100)

For more details on SUMPRODUCT
Bob Phillips
http://www.xldynamic.com/source/xld.SUMPRODUCT.html
J.E McGimpsey
http://mcgimpsey.com/excel/formulae/doubleneg.html
best wsihes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Brad E." wrote in message
...
Column A contains 5-digit codes. The third digit is a distance code, and
I
want to sum entries in column C if the third digit is 4, 5 or 6. The only
other codes for the third digit are 1, 2 and 3, so I can use "3" since
there
won't be anything over 6.

=SUMIF(MID(A1:A100,3,1),"3",C1:C100) isn't working for me.

Thank you, Brad




T. Valko

SumIf help
 
You'll need to convert the result of MID to a number:

=SUMPRODUCT(--(--MID(A1:A100,3,1)3),C1:C100)

--
Biff
Microsoft Excel MVP


"Bernard Liengme" wrote in message
...
=SUMPRODUCT(--(MID(A1:A100,3,1)3),C1:C100)

For more details on SUMPRODUCT
Bob Phillips
http://www.xldynamic.com/source/xld.SUMPRODUCT.html
J.E McGimpsey
http://mcgimpsey.com/excel/formulae/doubleneg.html
best wsihes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Brad E." wrote in message
...
Column A contains 5-digit codes. The third digit is a distance code, and
I
want to sum entries in column C if the third digit is 4, 5 or 6. The
only
other codes for the third digit are 1, 2 and 3, so I can use "3" since
there
won't be anything over 6.

=SUMIF(MID(A1:A100,3,1),"3",C1:C100) isn't working for me.

Thank you, Brad







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

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