+ Reply to Thread
Results 1 to 5 of 5

Compare a Cell Value with first numbers in another cell.

  1. #1
    Registered User
    Join Date
    12-10-2012
    Location
    Houston
    MS-Off Ver
    Excel 2010
    Posts
    20

    Compare a Cell Value with first numbers in another cell.

    Looking to compare a changing user chosen value in one cell - to the first number(s?) of another cell.

    Example file included.

    Thank you, T.
    Attached Files Attached Files

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Compare a Cell Value with first numbers in another cell.

    Hi hoventim,

    Try using below formula:-

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


    See attached:- Head Example.xlsx

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Registered User
    Join Date
    12-10-2012
    Location
    Houston
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Compare a Cell Value with first numbers in another cell.

    Hi Dilipandey and thank you,

    Using your example file if I input 11-19, (but not 20?), 21, or 101 into cell M2 I get unexpected results.

    I works with some values in cell M2, but not these and some others?

  4. #4
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Compare a Cell Value with first numbers in another cell.

    Hi Hoventim,

    It will not work for 11-19 but it should work for 11,12,13,14,15,16,17,18,19 as formula is searching first number from column A in cell M2 and if found it is returning "2" in I2 .. hope this clarifies. thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  5. #5
    Registered User
    Join Date
    12-10-2012
    Location
    Houston
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: Compare a Cell Value with first numbers in another cell.

    Here is what I eneded up with. I believe my problem was Collum 2 looked like numbers but were in fact a text string. Therefore I added "*1" to make it a number.

    And/or another problem I think i was having with Dilipandey's formula was sometiimes the numbers were one digit and sometimes they were two digit.

    So here it is, assuming A2 is the cell you are searching thru, and cell $M$2 contains the number you are searching for.

    =IF((LEFT( A2, FIND( " ", A2 ) - 1 )*1)=$M$2,"yes,"no")

    Great Excel Forum I've found much info! SOLVED !!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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