+ Reply to Thread
Results 1 to 13 of 13

if text contains number between two values

  1. #1
    Registered User
    Join Date
    12-31-2016
    Location
    israel
    MS-Off Ver
    2016
    Posts
    36

    if text contains number between two values

    hi, i have a range with text - letters and numbers, i would like to set a text in the next cell according to the numbers in the range. for example:
    A B
    CC189-001 ZONE2
    CC190-003 ZONE2
    CC172-004
    CC194-005 ZONE2


    i used the following formula in B1 and down:
    =IF(SUM(COUNTIF(A1,{"*189*","*190*","*192*","*193*","*194*"})),"ZONE2","")
    how can i change this formula to work between values? in this case 189-190 OR 192-194
    thanks!

  2. #2
    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,719

    Re: if text contains number between two values

    Do you only have one zone? I am guessing this isn't quite the full picture.

    There are instructions at the top of the page explaining how to attach your sample workbook.
    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.

  3. #3
    Registered User
    Join Date
    12-31-2016
    Location
    israel
    MS-Off Ver
    2016
    Posts
    36

    Re: if text contains number between two values

    true, i have more than one zone
    file attached
    thank you
    Attached Files Attached Files

  4. #4
    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,719

    Re: if text contains number between two values

    Is this accurate? If so, how do we decide which zone when there is an overlap?

    Excel 2016 (Windows) 32 bit
    E
    F
    1
    ZONE1 ZONE2
    2
    159-199 189-194
    Sheet: Sheet1

  5. #5
    Registered User
    Join Date
    12-31-2016
    Location
    israel
    MS-Off Ver
    2016
    Posts
    36

    Re: if text contains number between two values

    oops, soory, zone1 is 195-199

  6. #6
    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,719

    Re: if text contains number between two values

    Right - let's start again. Correct your workbook, check it CAREFULLY and upload again.

  7. #7
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: if text contains number between two values

    IWA-G2-001
    IWA-G2-002

    What to do with this sort ?
    Quang PT

  8. #8
    Registered User
    Join Date
    12-31-2016
    Location
    israel
    MS-Off Ver
    2016
    Posts
    36

    Re: if text contains number between two values

    OK, i fixed the zones list
    Attached Files Attached Files

  9. #9
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: if text contains number between two values

    Try in B1:
    Please Login or Register  to view this content.
    Drag down
    Attached Files Attached Files

  10. #10
    Valued Forum Contributor
    Join Date
    12-14-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2007
    Posts
    439

    Re: if text contains number between two values

    I have modified your lookup table to suit with the formula (yellow area in the image).
    Please Login or Register  to view this content.
    Capture.JPG
    Attached Files Attached Files
    Last edited by huuthang_bd; 06-30-2020 at 09:24 PM.

  11. #11
    Registered User
    Join Date
    12-31-2016
    Location
    israel
    MS-Off Ver
    2016
    Posts
    36

    Re: if text contains number between two values

    thank you very much!!
    this helped me alot

  12. #12
    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,719

    Re: if text contains number between two values

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

    Sorry for off-topic interjection:

    @ huuthang_bd


    Although there is no official rule regarding this behaviour, we request that wherever possible both the question AND the answer be provided in substantive detail here within the thread. An attached workbook is an excellent aid for posing a question and offering a solution, but solely doing that with no in thread explanation makes it difficult for researchers to understand or consider the Q & A of this thread without downloading what may be a pointless doc to them, if they can do that at all. Doing that also hides the content from search engines so others may never benefit from this.

    I'm sure you understand, and we look forward to seeing you post your formulas/macros in your posts for the searching benefit of all.

  13. #13
    Valued Forum Contributor
    Join Date
    12-14-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2007
    Posts
    439

    Re: if text contains number between two values

    Hi Ali,

    Thank for your advice, I got it. The post was edited.

    Huuthang

+ 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. Trying to return a number of different text values
    By ExcelLevel0 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-19-2020, 07:21 PM
  2. Sorting Ranges with Text Values and Number Values using Formula
    By oudavid1 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-27-2017, 03:05 PM
  3. [SOLVED] Geting highest number value from list with values which are text/number combinations
    By igormigor in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-25-2016, 10:48 AM
  4. How do I replace the number values with corresponding text ?
    By paul_drive in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-22-2013, 01:42 PM
  5. [SOLVED] Changing number values into sequential text values.
    By alex.l_91 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-17-2013, 02:37 AM
  6. Calculating Number's Between - two text values
    By angryrugbyman in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-14-2012, 06:20 PM
  7. Difference between values Text + Number
    By hpunaro in forum Excel General
    Replies: 3
    Last Post: 05-18-2010, 05:14 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