+ Reply to Thread
Results 1 to 8 of 8

If cell begins with

  1. #1
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    If cell begins with

    Hi,

    What is the cleanest way of having an if formula where if cell A1 begins with either a 1,2,3,4,5 then return “Bals” if not return “OPER”?

    Paul

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,624

    Re: If cell begins with

    Hi there. Try this, which will work with alphanumeric cells (you didn't specify if that was the case) and will NOT return the wrong result if the first alphanumberic character is zero:
    =IF(AND(CODE(LEFT(A1,1))>48,CODE(LEFT(A1,1))<54),"Bals","Oper")
    Last edited by Glenn Kennedy; 05-06-2015 at 12:45 PM.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: If cell begins with

    Hi

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


    And if the first character will always be a digit then

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

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: If cell begins with

    OR

    =IF(MIN(SEARCH({0,1,2,3,4,5},A1&1/17))=1,"Bals","OPER")
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  5. #5
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: If cell begins with

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  6. #6
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,689

    Re: If cell begins with

    Hi All

    wow - so many great responses! Thank you all

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: If cell begins with

    Glad to have helped and thanks for the rep.

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,624

    Re: If cell begins with

    Likewise...

+ 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. If Cell Begins with a Letter, Output...
    By Ocean Zhang in forum Excel General
    Replies: 8
    Last Post: 09-28-2022, 08:50 AM
  2. [SOLVED] If cell begins with 8 then OS, else BS
    By Lisa_NYC in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-23-2014, 04:51 PM
  3. [SOLVED] if cell BEGINS WITH abc, then return 123, or if cell BEGINS WITH def, then 456, ...
    By Marijke in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-29-2013, 11:20 AM
  4. IF Cell Contains Text That Begins With....
    By sabrefan27 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-22-2007, 03:30 AM
  5. Looping Sum, If cell begins With
    By jonn in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-07-2007, 09:13 AM

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