+ Reply to Thread
Results 1 to 3 of 3

How to Convert Text To Number in Excel

  1. #1
    Registered User
    Join Date
    01-16-2013
    Location
    Bangalore
    MS-Off Ver
    Excel 2010
    Posts
    1

    How to Convert Text To Number in Excel

    Hi All,

    1. I have cell A! filled with 5:1 and the cell ix "TEXT" formatted.
    2. I want to extract 5 out of it (I did the same using the formula =LEFT(A1,FIND(":",A1,1)-1) ).
    3. Now i want to check a condition whether 5 (extracted value) is < 6 (Here 6 is constant not in any cell).
    4. I tried with =IF((LEFT(C12,FIND(":",C12,1)-1)<"5"),"YES","NO") but it is always printing NO as result even though if i change the value in cell A1 to 5 or 7.

    Any help appreciated. Further i need to extract second part and check that value for some condition.

    Regards,
    Nagaraja S

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: How to Convert Text To Number in Excel

    use this:

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


    Also, it would be better to use:

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

    to avoid error

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: How to Convert Text To Number in Excel

    You are comparing text strings. Do it this way:

    =IF(--LEFT(C12,FIND(":",C12,1)-1)<6),"YES","NO")

    To extract the second number (as a number) you can use:

    =--RIGHT(C12,LEN(C12)-FIND(":",C12,1))

    The double-minus converts the text value to a number, but you can also add zero or multiply by 1 to get the same effect (-- is the same as multiplying by -1 twice, but is quicker to type).

    Hope this helps.

    Pete

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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