ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   COUNTIF using exclusions (https://www.excelbanter.com/excel-worksheet-functions/69111-countif-using-exclusions.html)

djDaemon

COUNTIF using exclusions
 
I have a column (C) that contains several part numbers (which are comprised
of text and numbers). I want to sum all the occurences of "RY..." cells,
excluding those which end with "...GBMK".

Is there an easy way to do this?

Ron Coderre

COUNTIF using exclusions
 
Try something like this:

With a list in A1:A10

B1: =COUNTIF(A1:A10,"RY*")-COUNTIF(A1:A10,"RY*GMBK")

Does that help?

***********
Regards,
Ron

XL2002, WinXP-Pro


"djDaemon" wrote:

I have a column (C) that contains several part numbers (which are comprised
of text and numbers). I want to sum all the occurences of "RY..." cells,
excluding those which end with "...GBMK".

Is there an easy way to do this?


Dave Breitenbach

COUNTIF using exclusions
 
With below table as sample for a1 thru b5 (and c1 with the following formula:
=SUMPRODUCT(--(LEFT(A1:A5,2)="ry"),--(RIGHT(A1:A5,4)<"gbmk"),--(B1:B5))

ry4355 6 31
ry453 7
ry346gbmk 8
fr5tgbmk 9
ry4543sf 10


hth,
Dave
"djDaemon" wrote:

I have a column (C) that contains several part numbers (which are comprised
of text and numbers). I want to sum all the occurences of "RY..." cells,
excluding those which end with "...GBMK".

Is there an easy way to do this?


djDaemon

COUNTIF using exclusions
 
Thank you both for your help!




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

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