Countif using left

bsnapool

Active Member
Joined
Jul 10, 2006
Messages
452
Hi All

I have a different sets of data which could vary with letters in front of a date E.g.

A B C
C 12/05/2006, S 15/05/2003, 16/08/2006

I am looking to do a countif formulae using the left to count "C" before the date. My range is C:N

Any help would be really appreciated
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Hi Andrew

You can do this by using wildcards:

=COUNTIF(C1:N1,"C*")

which will count cells in C1:N1 which begin with a C.
 
Upvote 0
Is that the only criteria .... the first letter of the cell entries? If so, then:
Code:
=COUNTIF(C:N,"C*")
would do it, wouldn't it?
 
Upvote 0
Thanks guys, dont know I never thought of this... Worked, thanks for your help...

Just out of interest... how would this work if another code was "cb" before the date?

Andrew
 
Upvote 0
Andrew

In that case you'd need to change your criteria maybe to "C *" (note the space). It will depend on the structure of your data (ie is a space after the letter valid?). If you need to enter more criteria to ensure the correct result, you will need to consider Sumproduct instead.
 
Upvote 0
Thanks guys, dont know I never thought of this... Worked, thanks for your help...

Just out of interest... how would this work if another code was "cb" before the date?

Andrew
One way might be this:
1. In A1 count the 'CB' entries with =COUNTIF(C:N,"CB*")
2. In A2 count the 'C' entries with =COUNTIF(C:N,"C*")-A1
 
Upvote 0

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top