+ Reply to Thread
Results 1 to 20 of 20

COUNTIF() help I do not know how to make it working

  1. #1
    Registered User
    Join Date
    12-26-2019
    Location
    Italy
    MS-Off Ver
    Office 365 MSO a 64 bit - Versione 1911
    Posts
    9

    COUNTIF() help I do not know how to make it working

    Hi, I need a formula.

    Column "B" has "names + surnames" with even homonyms & duplicated people.

    Column "M" contains ONLY SURNAMES that I need to highlight if present in column “B”.

    I want all the cells of column B, containing the single txt WORDS of the cells of column M, to be formatted with
    bold PURPLE colour font.

    The search must be of the text, among the single words in B, not of entire cells.
    Column B contains 10.000 people with duplicates of with the same surname or even homonymous names.


    I have been suggested to use the COUNTIF() function, to check if a text entry is found in another column as in the COUNTIF() formula the key is to use "*"& the search cell and another &"*" wildcard to search column B.
    So, they suggested to make a new “N” or “helper” column and then to write this in N:

    =COUNTIF($B$2:$B$10,"*"&M2&"*")
    This counts if any part of M is found in B.
    Then they said to use a formula in the conditional formatting FORMULA:
    =O2=1
    and apply to column B with FILL = PURPLE

    Unfortunately I do not know where and how to input the COUNTIF() formula in coloum N
    and I do not know where and how insert the formatting formula =O2=1
    and where and how to apply to column B with FILL = PURPLE.

    Can you help? Thanks, Max
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,741

    Re: COUNTIF() help I do not know how to make it working

    Hi & welcome to the board.
    No need for a helper column.
    Select B2:B10 > Conditional Formatting > New rule > Use a formula > Use
    =COUNT(SEARCH($M$2:$M$10,B2))

    Select your format > OK.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    12-26-2019
    Location
    Italy
    MS-Off Ver
    Office 365 MSO a 64 bit - Versione 1911
    Posts
    9

    Re: COUNTIF() help I do not know how to make it working

    Thanks a lot!

    I did try and, as many times before, I get this error :-(:

    error.jpg

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,741

    Re: COUNTIF() help I do not know how to make it working

    You will need to convert the formula to match you language.
    If you update your profile to show what country you are in, then I can help with that. But having a location of "here" is of no help at all.

  5. #5
    Registered User
    Join Date
    12-26-2019
    Location
    Italy
    MS-Off Ver
    Office 365 MSO a 64 bit - Versione 1911
    Posts
    9

    Re: COUNTIF() help I do not know how to make it working

    Thanks a lot, I inserted the country. I already translated using the file you sent:

    =CONTA.NUMERI($M$2:$M$7056,B2))

    The specific xls example file you sent me is working fine, thanks a lot. Anyway, when I insert the formula in my original large file, today I get the error , while yesterday night I had no errors, but anyway nothing happened (it was not working).

    I checked your file and I see 3 different formulas:

    =CONTA.NUMERI(RICERCA($M$2:$M$10;B2))

    [only cells containing] $B$2:$B$7056

    [Value between] ="B2+$B$2:$B$7056" and ="$B$2:$B$7056"

    his-3-formulas.jpg

    I do not know how to insert them...

    When I select the 19.002 cells in B, and I use the formula you gave me:
    =CONTA.NUMERI($M$2:$M$7056,B2))

    together with the purple format. I am now getting the error again:

    exempl.jpg

    error2.jpg

    It is strange because yesterday the very same translated formula at least was accepted even if it did not gave any results (there are many surnames that should become purple on B)

    Sorry I am quite a basic user of Excell, thanks again for any hint..

    Max
    Last edited by MaxDp2020; 12-27-2019 at 08:59 AM. Reason: Picture's Problems

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

    Re: COUNTIF() help I do not know how to make it working

    Deleted this post.Error on my part
    Last edited by Pepe Le Mokko; 12-27-2019 at 11:08 AM.

  7. #7
    Registered User
    Join Date
    12-26-2019
    Location
    Italy
    MS-Off Ver
    Office 365 MSO a 64 bit - Versione 1911
    Posts
    9

    Re: COUNTIF() help I do not know how to make it working

    Thanks Pepe. Max
    Last edited by MaxDp2020; 12-27-2019 at 11:33 AM. Reason: added explanations

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,741

    Re: COUNTIF() help I do not know how to make it working

    You have a comma in the formula, when I think it should be a semicolon.
    =CONTA.NUMERI($M$2:$M$7056;B2))

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

    Re: COUNTIF() help I do not know how to make it working

    Sorry Max, didn't see the file as it was attached to an image

  10. #10
    Registered User
    Join Date
    12-26-2019
    Location
    Italy
    MS-Off Ver
    Office 365 MSO a 64 bit - Versione 1911
    Posts
    9

    Re: COUNTIF() help I do not know how to make it working

    I did correct with the ";"

    =CONTA.NUMERI($M$2:$M$7056;B2))

    but I still get the error..

    Could it be a bug in Excel?

    error3.jpg

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,391

    Re: COUNTIF() help I do not know how to make it working

    Ditch the final bracket:

    =CONTA.NUMERI($M$2:$M$7056;B2)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  12. #12
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,741

    Re: COUNTIF() help I do not know how to make it working

    Hadn't noticed that the SEARCH function was missing, it should be
    =CONTA.NUMERI(RICERCA($M$2:$M$10;B2))

  13. #13
    Registered User
    Join Date
    12-26-2019
    Location
    Italy
    MS-Off Ver
    Office 365 MSO a 64 bit - Versione 1911
    Posts
    9

    Re: COUNTIF() help I do not know how to make it working

    Thanks! Now it is working! Anyway, the formula makes errors:

    It does not mark all "Wallace" for example, only 5 or 6 of them,

    and it marks us present surnames also "pieces of the complete txt string",

    specially the names listed us: *Mary
    (which sometimes have * prefix)

    or

    if it has to search and underline "Smith", it underlines also "Aerosmith" or "Smithson".. but this is quite natural and probably unavoidable.

    The main problem is that it does NOT underline ALL the Smith in the 19.000 people list..

    Any clue? Thanks again, great job! Really thanks.

    Max
    Last edited by MaxDp2020; 12-27-2019 at 12:27 PM. Reason: added explanations

  14. #14
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,741

    Re: COUNTIF() help I do not know how to make it working

    Can you supply a new sample file that shows these problems?

  15. #15
    Registered User
    Join Date
    12-26-2019
    Location
    Italy
    MS-Off Ver
    Office 365 MSO a 64 bit - Versione 1911
    Posts
    9

    Re: COUNTIF() help I do not know how to make it working

    I believe the problem with the NOT marked (purple) surnames is because 19.002 are many and I am seeing them coming and going!
    Unfortunately I cannot share the main file for their privacy but I think the problem is too much memory used so excel keeps changing.

    Is there a way, after the formula, to sostitute the purple with, for example red, in order to unlink the marked ones from any formula ?

    I do know the find and replace menu but it does not find and replace only the colour, it needs a txt.

  16. #16
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,741

    Re: COUNTIF() help I do not know how to make it working

    I'm afraid I don't understand what you mean.

  17. #17
    Registered User
    Join Date
    12-26-2019
    Location
    Italy
    MS-Off Ver
    Office 365 MSO a 64 bit - Versione 1911
    Posts
    9

    Re: COUNTIF() help I do not know how to make it working

    Sure, sorry. I try to express a little better:

    To run a "find and replace" the excel function form need a txt or number.

    It would be good to run a found "purple" and replace it with "red". But this seems impossible (to me).

    In that way I would replace the purple formatting and just copy and paste the entire column, taking away our formatting formula once used.
    (which for 19.000 entries, seems as always calculating and giving "visual" errors..maybe just for memory..)

    I told before that for ex. the surname Wallace was not always in purple after applying the conditioned formula, but this is not totally right, if I scroll the screen or click near a white Wallace cell it get purple.. So it is a matter of memory...

  18. #18
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,741

    Re: COUNTIF() help I do not know how to make it working

    You would have to do that with VBA, in which case you could just get rid of the CF.

  19. #19
    Registered User
    Join Date
    12-26-2019
    Location
    Italy
    MS-Off Ver
    Office 365 MSO a 64 bit - Versione 1911
    Posts
    9

    Re: COUNTIF() help I do not know how to make it working

    I thank you very much for your help. Best regards. Max

  20. #20
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,741

    Re: COUNTIF() help I do not know how to make it working

    You're welcome & thanks for the feedback

+ 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. How to make COUNTIF immutable?
    By epsydon in forum Excel General
    Replies: 2
    Last Post: 09-01-2019, 12:50 PM
  2. [SOLVED] Can't make countif return the value I want.
    By cayuga306 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-09-2019, 01:00 PM
  3. multiple if statement not working but not working (make sense!)
    By vanessafvg in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-17-2018, 12:06 AM
  4. Replies: 8
    Last Post: 05-27-2017, 07:04 AM
  5. I can't make this countif equation work. Help
    By Holden Wright in forum Excel Tips
    Replies: 5
    Last Post: 02-04-2016, 06:30 AM
  6. trying to make a button on summary page to make new working sheet
    By dbzisme in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 04-07-2013, 05:41 PM
  7. [SOLVED] How do you make a countif formula with 2 or more critera?
    By Melissa in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-24-2005, 08:05 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