Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
 
Posts: n/a
Default Countif with star operator in criteria


Dear all,

after having searched this group and google-ed and beating my own
brains, I still can't find a (elegant) solution to this small but
rather annoying issue....some help would be appreciated....even when I
am overlooking the obvious.....
Here it is: using COUNTIF to find number of occurrences of a value in a
range in which the value can contain a star operator ( * ).
Example: countif gives this
Column A Column B = Countif($A$4,A2)
FT1305 1
FT1305* 3
FT1305* 3

While I am looking for:
Column A Column B = Function(?????)
FT1305 1
FT1305* 2
FT1305* 2

Any ideas?

Thanks on behforehand,

regards,

Elly

  #2   Report Post  
 
Posts: n/a
Default Countif with star operator in criteria

Oops, typo in the original post:

Example should of course be;
Example: countif gives this
Column A Column B = Countif($A$2:$A$4,A2)
FT1305 1
FT1305* 3
FT1305* 3

While I am looking for:
Column A Column B = Function(?????)
FT1305 1
FT1305* 2
FT1305* 2

  #3   Report Post  
Bob Phillips
 
Posts: n/a
Default Countif with star operator in criteria

Do you mean?

=COUNTIF($A$2:$A$200,A2)

and copy down

--

HTH

RP
(remove nothere from the email address if mailing direct)


wrote in message
oups.com...

Dear all,

after having searched this group and google-ed and beating my own
brains, I still can't find a (elegant) solution to this small but
rather annoying issue....some help would be appreciated....even when I
am overlooking the obvious.....
Here it is: using COUNTIF to find number of occurrences of a value in a
range in which the value can contain a star operator ( * ).
Example: countif gives this
Column A Column B = Countif($A$4,A2)
FT1305 1
FT1305* 3
FT1305* 3

While I am looking for:
Column A Column B = Function(?????)
FT1305 1
FT1305* 2
FT1305* 2

Any ideas?

Thanks on behforehand,

regards,

Elly



  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default Countif with star operator in criteria

Ah, I see now.

Try this

=SUMPRODUCT(--(SUBSTITUTE($A$2:$A$4,"*","~")=SUBSTITUTE(A2,"*"," ~")))

--

HTH

RP
(remove nothere from the email address if mailing direct)


wrote in message
ups.com...
Oops, typo in the original post:

Example should of course be;
Example: countif gives this
Column A Column B = Countif($A$2:$A$4,A2)
FT1305 1
FT1305* 3
FT1305* 3

While I am looking for:
Column A Column B = Function(?????)
FT1305 1
FT1305* 2
FT1305* 2



  #6   Report Post  
 
Posts: n/a
Default Countif with star operator in criteria


Bob Phillips, Domenic,

both your solutions were the trick ! Thanks a lot for your great help,
even for this rather dumb question, it is much appreciated !

Regards,

Elly

  #7   Report Post  
 
Posts: n/a
Default Countif with star operator in criteria

While I am looking for:
Column A Column B = Function(?????)
FT1305 1
FT1305* 2
FT1305* 2


an alternative that I think will be more robust
=SUM(--EXACT(A2,$A$2:$A$4))
note: array entered (CTRL+SHIFT+ENTER)

and copied down

The exact returns an array of True and False
the -- changes them into 1 and 0 that can be summed

hth RES
  #8   Report Post  
Bob Phillips
 
Posts: n/a
Default Countif with star operator in criteria

An alternative, yes, but can you enlighten me as to why this might be more robust?

--

HTH

RP
(remove nothere from the email address if mailing direct)


wrote in message ...

While I am looking for:
Column A Column B = Function(?????)
FT1305 1
FT1305* 2
FT1305* 2


an alternative that I think will be more robust
=SUM(--EXACT(A2,$A$2:$A$4))
note: array entered (CTRL+SHIFT+ENTER)

and copied down

The exact returns an array of True and False
the -- changes them into 1 and 0 that can be summed

hth RES
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
countif criteria only one word of few doesn't work dcd123 Excel Worksheet Functions 3 August 22nd 05 01:46 PM
Countif w/ Multiple Criteria Patrick_KC Excel Worksheet Functions 2 August 9th 05 09:25 PM
countif variable criteria neda5 Excel Discussion (Misc queries) 3 May 3rd 05 10:55 AM
Countif using format criteria....not number criteria? Troy Excel Worksheet Functions 1 April 20th 05 04:50 AM
counting cells (COUNTIF) based on two or more criteria Tricia S. Excel Worksheet Functions 10 March 17th 05 02:17 PM


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

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

About Us

"It's about Microsoft Excel"