+ Reply to Thread
Results 1 to 8 of 8

Combining IF and LEFT into a formula just creates an error message

  1. #1
    Registered User
    Join Date
    02-20-2020
    Location
    Hamburg, Germany
    MS-Off Ver
    2019
    Posts
    4

    Combining IF and LEFT into a formula just creates an error message

    Dear reader,

    I want Excel to search column J accross 20 records. In all 20 J-cells there are different text strings. I want Excel to print the text string it finds in each of the J-cells into column K where I put the formula - if my formula's condition is met.

    My formula is =IF(LEFT(J17,3)="AR ";J17;"")

    This formula should look at the 3 leftmost characters in cell J17 and return the text string it finds in J17 - if it is true - into K17. If it is false, it should just return no visible content. However, this formula produces an error message. I just cannot find the reason for this malfunction.

    Please help!

  2. #2
    Forum Moderator 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
    27,331

    Re: Combining IF and LEFT into a formula just creates an error message

    Hi and welcome to the forum

    The formula looks OK to me. Please upload the workbook so that we can see your request in context.
    Richard Buttrey

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

  3. #3
    Registered User
    Join Date
    02-20-2020
    Location
    Hamburg, Germany
    MS-Off Ver
    2019
    Posts
    4

    Re: Combining IF and LEFT into a formula just creates an error message

    Thank you, Richard!

    I hope the file is attached. If not I will keep trying.
    Attached Files Attached Files

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Business (Win 10 - Work) & MS 365 Subscription Insider (Win 10 - Home)
    Posts
    43,898

    Re: Combining IF and LEFT into a formula just creates an error message

    C6 does not start with AR, so the formula returns blank.

    Are you sure you don't need this?

    =IF(LEFT(J17;3)="AR ";J17;"") - it should be all semi-colons for your locale.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!

    Forum Rules (updated September 2018): please read them here.
    How to use the Power Query code you've been given: help here. More about the Power suite here.
    Don't forget to say "thank you" to those who have helped you in your thread. If you wish, you can also reward them by clicking on their reputation star bottom left.

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,175

    Re: Combining IF and LEFT into a formula just creates an error message

    It works for me, (I have to change the semicolons to commas to support my local formatting). What error message do you get? Is your computer set up to use semi-colons or commas in formulas?

    I think Ali has it, you were using a comma between C6 and 3 instead of a semi colon.
    ChemistB
    My 2˘

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  6. #6
    Registered User
    Join Date
    02-20-2020
    Location
    Hamburg, Germany
    MS-Off Ver
    2019
    Posts
    4

    Re: Combining IF and LEFT into a formula just creates an error message

    Hi ChemistB,
    yes, Ali got it immediately.
    The error message read: "There's a problem with this formula. Not trying to type a formula? When the first chacter is an equal (=) or minus (_) sign, Excel thinks it's a formula: ..."
    But this apparent standard message did not help me.
    Many thanks for pointing the semicolons/ commas problems out to me.
    frago

  7. #7
    Registered User
    Join Date
    02-20-2020
    Location
    Hamburg, Germany
    MS-Off Ver
    2019
    Posts
    4

    Re: Combining IF and LEFT into a formula just creates an error message

    Hi Ali,
    great many thanks for your help! Now it works. I was not aware of this semicolon/ comma issue.
    frago

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Business (Win 10 - Work) & MS 365 Subscription Insider (Win 10 - Home)
    Posts
    43,898

    Re: Combining IF and LEFT into a formula just creates an error message

    You're welcome.

+ 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. Combining a formula creates different result
    By Median in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 04-16-2018, 12:01 PM
  2. [SOLVED] Error Message When Combining IF and COUNTIF Functions
    By EverClever in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-21-2017, 04:50 PM
  3. Combining a data validation list with a custom formula (including error message)
    By robgron in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-17-2014, 07:23 AM
  4. Replies: 9
    Last Post: 04-16-2014, 09:55 AM
  5. Error Message When Textbox in Userform Left Blank
    By zaclim78 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-07-2012, 12:19 PM
  6. Combining two macros results in error message
    By duugg in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-01-2009, 02:42 PM
  7. How to create an error message if cell left blank
    By Jeanne in forum Excel General
    Replies: 8
    Last Post: 06-09-2009, 02:49 PM

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