+ Reply to Thread
Results 1 to 9 of 9

If there are specific texts in several cells then=1

  1. #1
    Registered User
    Join Date
    04-18-2019
    Location
    BELFAST
    MS-Off Ver
    MS OFFICE 2013
    Posts
    4

    If there are specific texts in several cells then=1

    Dear all,

    I hope you can help me with this. I want to create a column where I get a 1(yes) or 2(no) depending on whether cells C38:K38 have any of these words " alamycin" " aurofac", "chloromed"...

    I've tried this formula but it doesn't work
    =IF($C38:$K38= OR("ALAMYCIN","AUROFAC","CHLOROMED","CTC"),1,2)

    I would appreciate your help!

    Many thnaks
    Last edited by ANAVPL; 04-18-2019 at 11:32 AM.

  2. #2
    Registered User
    Join Date
    04-01-2019
    Location
    HK
    MS-Off Ver
    2010
    Posts
    32

    Re: If there are specific texts in several cells then=1

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: If there are specific texts in several cells then=1

    Assuming the values in C38:K38 might be part of longer strings of text, put * in front of and behind each word you’re searching for. Like so:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    04-18-2019
    Location
    BELFAST
    MS-Off Ver
    MS OFFICE 2013
    Posts
    4

    Re: If there are specific texts in several cells then=1

    Thank you so much for this! It works perfectly

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,790

    Re: If there are specific texts in several cells then=1

    This is more compact:

    =IF(SUM(COUNTIF(C$3:K$3,{"ALAMYCIN","AUROFAC","CHLOROMED","CTC")}))>0,1,2)

    Please mark the thread as solved.
    Last edited by AliGW; 04-19-2019 at 05:57 AM.
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  6. #6
    Registered User
    Join Date
    04-18-2019
    Location
    BELFAST
    MS-Off Ver
    MS OFFICE 2013
    Posts
    4

    Re: If there are specific texts in several cells then=1

    One more question on these if you don't mind:
    would it be possible to get, instead of just 1 for finding any of those words, to get the actual count of those words in C3:K3?
    Thanks!

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,790

    Re: If there are specific texts in several cells then=1

    Of course! Use this bit of the formula:

    =SUM(COUNTIF(C$3:K$3,{"ALAMYCIN","AUROFAC","CHLOROMED","CTC"}))

  8. #8
    Registered User
    Join Date
    04-18-2019
    Location
    BELFAST
    MS-Off Ver
    MS OFFICE 2013
    Posts
    4

    Re: If there are specific texts in several cells then=1

    Thank you!

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,790

    Re: If there are specific texts in several cells then=1

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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: 11
    Last Post: 04-09-2019, 09:50 AM
  2. [SOLVED] Counting list of specific texts inside the cells
    By Sekars in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-08-2016, 04:08 AM
  3. [SOLVED] To average cells included texts - how to ignore texts in those cells - help please
    By PrayoonD in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-23-2014, 12:32 PM
  4. [SOLVED] VBA Help needed to fill cells with some specific texts based on multiple conditions
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-18-2014, 12:52 PM
  5. [SOLVED] Message box pup up when cell contains specific texts
    By kleevin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-02-2013, 02:03 AM
  6. [SOLVED] VLOOKUP containing specific texts
    By JakeMann in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-25-2013, 11:48 AM
  7. Summing specific texts
    By LostLady in forum Excel General
    Replies: 3
    Last Post: 06-09-2005, 01:10 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