+ Reply to Thread
Results 1 to 16 of 16

Searching a cell value for a Character

Hybrid View

  1. #1
    Registered User
    Join Date
    01-15-2008
    Posts
    66

    Question Searching a cell value for a Character

    Hi all,
    Thanks for all the help so far. I have a final challenge for my program.

    I want to test a cell for the type of value as 678/256 or 345/872/098/987 etc. The common character in each would be the "/". First, I need to check the cell for this, then take the first number and compare it to an integer(if it is <> , or = to). I hope I am clear with my situation. All help is welcomed

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    You mean something like:

    =IF(ISNUMBER(FIND("/",A1)),IF(LEFT(A1,FIND("/",A1)-1)+0=B1,"ok","not ok"))
    where A1 contains original code and B1 contains number to compare to.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    01-15-2008
    Posts
    66
    Thanks,
    I can play with those statments. what I am looking for is something like:

    If cells(i,"G").value contain "/" then flag=1
    If flag=1 then retrieve "first number" of value as integer

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    If you were looking for a VBA solution, you should've posted in the Programming forum...

    We'll see if someone with VBA skills will join and add a suggestion.

  5. #5
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good afternoon dsexpress

    For clarification - are you wanting to extract each number from the string in a cell?
    What are you hoping to compare them to?

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  6. #6
    Registered User
    Join Date
    01-15-2008
    Posts
    66
    I just want to get the first number: eg

    289/345/896 result would be integer 289
    23/45 " " integer 23
    684/234/123/456 ' '' integer 684


    I am then comparing this value to a sum of numbers in a collection of cells

    Thanks

  7. #7
    Registered User
    Join Date
    01-15-2008
    Posts
    66
    How do I lable this thread closed?

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    No need .

+ 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