+ Reply to Thread
Results 1 to 8 of 8

Excel function: countifs with nested OR function and wildcards

  1. #1
    Registered User
    Join Date
    09-17-2020
    Location
    England
    MS-Off Ver
    10
    Posts
    4

    Excel function: countifs with nested OR function and wildcards

    Hi, can anyone help please.

    My formula keeps returning an #VALUE error.

    I will attach a sample data (different from my original but is simplified and will do the job).
    I put the formula and formulated my question on it.

    Please beware I am not very advanced on Excel so I don't understand anything too complicated :-)

    Thank you!

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Excel function: countifs with nested OR function and wildcards

    Hi
    things would be much easier without merged cells for headers and different columns for the same object ( cities)
    Create a unique column for cities and a second column for collections. (eventually with a drop down list)
    Starting from there analysis of your data will be much easier

  3. #3
    Registered User
    Join Date
    09-17-2020
    Location
    England
    MS-Off Ver
    10
    Posts
    4

    Re: Excel function: countifs with nested OR function and wildcards

    Thanks Pepe, you might have a point. I just wonder if there is a way without changing the format simply because I have a much larger data set and sorting through the combination of each city/collection would be really time consuming. Is that the only way?

  4. #4
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,781

    Re: Excel function: countifs with nested OR function and wildcards

    F2=SUMPRODUCT((ISNUMBER(MATCH($A2:$C2,$I$2:$I$3,0)))*(ISNUMBER(SEARCH($H$2,$D2)))*(ISNUMBER(SEARCH($H$3,$D2))))

    Copy down

  5. #5
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Excel function: countifs with nested OR function and wildcards

    It is the best way, as you will continually be putting fixes in the data. It would be good to have model answers for the current sample. you are only looking at 1 row
    =COUNTIFS($A2:$C2,OR("*Sy*City*","Sydney*"),$D2,"bags*Accessories*")

    is it if(d2="*Accessories*",sum(COUNTIFS($A2:$C2,{"*Sy*City*","Sydney*"})),"")

    things are hard coded and you are continually applying fixes for mis typing. Always better to standardised or clean at the source

  6. #6
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,583

    Re: Excel function: countifs with nested OR function and wildcards

    Try this. In F2 then copied down.

    =SUM((SUM(COUNTIF($D2,{"bags*","*Accessories*"}))>0)*(SUM(COUNTIFS($A2:$C2,{"*Sy*","*City*","Sydney*"}))))
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  7. #7
    Registered User
    Join Date
    09-17-2020
    Location
    England
    MS-Off Ver
    10
    Posts
    4

    Re: Excel function: countifs with nested OR function and wildcards

    Caracalla it seems to be working, thank you!! And what a complex formula....wonder if I can sneak you in to the office haha don't go far ;-)

  8. #8
    Registered User
    Join Date
    09-17-2020
    Location
    England
    MS-Off Ver
    10
    Posts
    4

    Re: Excel function: countifs with nested OR function and wildcards

    Davsth and kvsrinivasamurthy thank you too for your help/tips :-)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 01-05-2019, 03:33 AM
  2. COUNTIFS function makes excel slow, how to make the function "shorter"
    By Gifupack in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-07-2015, 07:01 AM
  3. Calling function inside function. (aka nested function)
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-02-2015, 05:58 AM
  4. [SOLVED] Countifs function in excel
    By prakash_repalle in forum Excel General
    Replies: 5
    Last Post: 05-16-2015, 03:19 AM
  5. COUNTIF/COUNTIFS function + nested user-defined function
    By shamjamali in forum Excel General
    Replies: 1
    Last Post: 05-12-2015, 09:12 PM
  6. Using a VBA function nested in a Excel function
    By ceebee in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-14-2009, 11:41 AM
  7. Equivalent of countifs function for Excel 2003?
    By oneyejack in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-29-2007, 12:51 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1