+ Reply to Thread
Results 1 to 16 of 16

IF statement returning #NAME

  1. #1
    Registered User
    Join Date
    04-13-2017
    Location
    the Netherlands
    MS-Off Ver
    2016
    Posts
    7

    Question IF statement returning #NAME

    = IF(B2 = C2, "PASS", "FAIL")
    returns #NAME. I'm trying to compare two variables and if they match, have it return a PASS
    Does anybody see an error in my statement?


    Hope to hear from you soon,
    -Jonathan

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,444

    Re: IF statement returning #NAME

    Hi,

    Are you able to post the workbook? I have copied and pasted your formula into a sheet and it generates no error for me.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: IF statement returning #NAME

    Apart from removing the spaces I cant see anything wrong.

    Post the spreadsheet.
    Use the Go Advanced option at the bottom of the page then scroll down to Manage Attachments as the "paperclip" method does not work on this forum.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  4. #4
    Registered User
    Join Date
    04-13-2017
    Location
    the Netherlands
    MS-Off Ver
    2016
    Posts
    7

    Re: IF statement returning #NAME

    Quote Originally Posted by sweep View Post
    Hi,

    Are you able to post the workbook? I have copied and pasted your formula into a sheet and it generates no error for me.


    Is this good enough?
    https://1drv.ms/x/s!At4b_T2RkzDNg8J69DODJwb38iEuPg

  5. #5
    Registered User
    Join Date
    04-13-2017
    Location
    the Netherlands
    MS-Off Ver
    2016
    Posts
    7

    Re: IF statement returning #NAME

    Aaah,alright.
    Here you go.

    Just some extra information, i added spaces after trying without them, as i thought maybe it needed spaces...
    (Looked like it had spaces when i saw examples online while searching for the error.)
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: IF statement returning #NAME

    As stated before, remove the spaces.
    It then works.

    UPDATE: Actually it works if you press F2 to edit the formula and hit return leaving the spaces in.
    There must be a spurious character in the formula that's not being displayed.

  7. #7
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: IF statement returning #NAME

    Quote Originally Posted by Special-K View Post
    As stated before, remove the spaces.
    It then works.
    I don't think so, extra spaces can't bother the formula... May b Jona has copied the formula and pasted it into cell. If he will do edit with F2 and then enter it would work....
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  8. #8
    Registered User
    Join Date
    04-13-2017
    Location
    the Netherlands
    MS-Off Ver
    2016
    Posts
    7

    Re: IF statement returning #NAME

    Quote Originally Posted by shukla.ankur281190 View Post
    I don't think so, extra spaces can't bother the formula... May b Jona has copied the formula and pasted it into cell. If he will do edit with F2 and then enter it would work....
    Nah, i typed it out myself, I am a programmer.
    Just not very good in excel^^

  9. #9
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: IF statement returning #NAME

    There's no extra characters, formula is 29 characters long and all non visible characters are spaces ASCII 32.
    But as said hitting F2 and enter resolves the problem.

  10. #10
    Registered User
    Join Date
    04-13-2017
    Location
    the Netherlands
    MS-Off Ver
    2016
    Posts
    7

    Re: IF statement returning #NAME

    Quote Originally Posted by Special-K View Post
    As stated before, remove the spaces.
    It then works.
    As you can see, even without spaces, it still doesn't work...
    Attached Images Attached Images

  11. #11
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: IF statement returning #NAME

    Quote Originally Posted by jona263d View Post
    Nah, i typed it out myself, I am a programmer.
    hahahah the excel understood, you are trying making something new thats why it return #NAME error.. BTW space is not a problem at all in any function of excel..... but when you will use any text function it can be change result.

  12. #12
    Registered User
    Join Date
    10-28-2008
    Location
    Turkey
    Posts
    88

    Re: IF statement returning #NAME

    .

    You should write IF function in your native language.

    May be IF=ALS

    .
    Last edited by yurttas; 04-13-2017 at 06:10 AM.

  13. #13
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: IF statement returning #NAME

    Quote Originally Posted by jona263d View Post
    As you can see, even without spaces, it still doesn't work...
    You must use ";" instead on "," .....

  14. #14
    Registered User
    Join Date
    04-13-2017
    Location
    the Netherlands
    MS-Off Ver
    2016
    Posts
    7

    Re: IF statement returning #NAME

    "You should write IF function in your native language."


    This works, wow. Thank you!
    I need to change back from Dutch to English lol...

  15. #15
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: IF statement returning #NAME

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  16. #16
    Registered User
    Join Date
    04-13-2017
    Location
    the Netherlands
    MS-Off Ver
    2016
    Posts
    7

    Re: IF statement returning #NAME

    Quote Originally Posted by shukla.ankur281190 View Post
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    Thank you

+ 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. [SOLVED] IF Statement Returning a value not to exceed certain value
    By pilotguy0914 in forum Excel Formulas & Functions
    Replies: 29
    Last Post: 12-29-2016, 08:03 AM
  2. [SOLVED] IF STatement returning 0 Value
    By Cian.Kelleher in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-15-2015, 09:04 AM
  3. [SOLVED] IF statement returning #VALUE error
    By Christopher135 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-05-2013, 12:59 AM
  4. IF Statement returning 0
    By buyshirts in forum Excel General
    Replies: 4
    Last Post: 07-16-2012, 09:03 AM
  5. Counting If statement and returning value
    By vicktown in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-19-2010, 03:13 PM
  6. If And Statement returning #VALUE
    By AESP920 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-26-2010, 03:22 PM
  7. if statement returning blanks
    By Mayrie in forum Excel General
    Replies: 3
    Last Post: 09-29-2009, 03:59 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