Excel Name Trick #6: Names COUNTIF & wildcards

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
16,218
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jun 13, 2008

See how to use the Names & Wildcards with the COUNTIF function. Search through a list of Addresses and count just the ones on Birch Street. Search through a list of Addresses and count just the ones on the 9000 block of Birch Street.

See the wildcard *
See the wildcard ?

This is a logical (beginning to end) story about most of the use for Excel Names. In this series you will see 12 amazing uses for Excel Names (14 total Name Tricks).

  • likes, 2 dislikes

Link to this comment:

Share to:

Uploader Comments (ExcelIsFun)

  • Nice shortcuts here! But is there a way to transform the cells examined in the criteria before applying it?

    For example, if there was a temporary name (e.g. TestValue) for the current cell being tested by the criteria, I'd like to do:

    =CountIf(A1:A100, WeekDay(TestValue) = 1)

    ...to count all Mondays in a range of date values? Without a placeholder for the tested cell value, I can't think of a way to do this other than by making a new column containing WeekDay(...) of every value in the range.

  • @batlin , maybe a formula like:

    =SUMPRODUCT(--WeekDay(TestValu­e) = 1) or =SUMPRODUCT(--WeekDay(A1:A100) = 1)

  • Hi! One thing I noticed is that this formula will also count Birchwood. A way to remedy this is to just add a space in the quotation marks like so: "* "&C8&" *". You can also use wildcard arrays with countif's too.

    Smith, John

    Vikki L. Smith

    Smithers, Jim

    =SUM(COUNTIF(A2:A20,{"","* "}&C1&{",*",""}))

    Typing Smith in C1 will return a 2.

  • Nice catch!!!

    Thanks for "robustifying" the formula!

  • This is exactly what I needed - and more, thank you so much!

  • You are welcome!

see all

All Comments (14)

Sign In or Sign Up now to post a comment!
  • @ExcelIsFun Hi thanks, you're spot on... I figured it out after about 30 mins of headscratching:

    =SUMPRODUCT(--(TEXT($A$1:$A$10­0, "ddd")=C3)*$B$1:$B$100) ... (where C1:C5 are "Mon"..."Fri", and I'm trying summing Bx to have a subtotal broken down by day)

    The criteria syntax is hackish... Since you can directly map from what I wanted into this SumProduct, it's strange that there's no placeholder/variable syntax in Excel... SumIf(A1:A100, Text(TestValue, "ddd")=C3, B1:B100) would be much simpler!

  • You are welcome! If you want to learn Excel, watch the 23 videos in the Basic Series, then move on to the 59 videos in the Highline Excel Class Series.

  • Your excel series is awesome!! Everything I learnt in a $600 excel course is clearly explained in your series. Keep it up!!!!

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more