+ Reply to Thread
Results 1 to 4 of 4

IF function based on alpha presence

  1. #1
    Registered User
    Join Date
    06-08-2009
    Location
    Southern Maryland
    MS-Off Ver
    Excel 2007
    Posts
    1

    IF function based on alpha presence

    can I create an IF function to do an operation based on the presence of an alphabetic letter in a numeric input?
    e.g
    an entry of 140 makes the next column show (140 - 100)
    but an entry of 140N makes the next column show 140.

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

    Re: IF function based on alpha presence

    Try:

    =If(Isnumber(A1+0),A1-100,Left(A1,Len(A1)-1)+0)

    This assumes if the item is alphanumeric, then it contains a letter at the end.
    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
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Re: IF function based on alpha presence

    Hi,

    Welcome to the forum, not exactly sure what you mean, but does this work for you?

    =IF(ISNUMBER(A1),A1-100,LEFT(A1,LEN(A1)-1)+0)
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  4. #4
    Forum Contributor
    Join Date
    04-23-2009
    Location
    IOWA
    MS-Off Ver
    2010 Professional
    Posts
    270

    Re: IF function based on alpha presence

    My thougths were:

    =IF(RIGHT(A1,1)="N",LEFT(A1,(LEN(A1)-1)),A1 & " - " & A1-40)

    This will allows for multiple nested ifs if he has more then one letter to use.

    I think he was shooting for a range if not a number.

    Hope this helps,

    Dan
    Last edited by split_atom18; 06-08-2009 at 03:29 PM. Reason: added 3rd line
    "I am not a rocket scientist, I am a nuclear engineer." - Split_atom18
    If my advice has been helpful to you, then please help me by clicking on the "Star" and adding to my reputation, Thanks!

+ 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