+ Reply to Thread
Results 1 to 7 of 7

IF statement with multiple AND returning #NAME? error

Hybrid View

  1. #1
    Registered User
    Join Date
    10-10-2016
    Location
    Coimbra, Portugal
    MS-Off Ver
    2016
    Posts
    86

    IF statement with multiple AND returning #NAME? error

    Hi all.
    I'm getting a #NAME? error on this formula.
    =IF($ah8 >=3; ”Infancy”;
        IF(AND($ah8 >=4; $ah8 <=11); ”Childhood”;
           IF(AND($ah8 >=12; $ah8 <=20); ”Adolescence”;
              IF(AND($ah8 >=21; $ah8 <=35); ”Early adulthood”;
                 IF(AND($ah8 >=36; $ah8 <=50); ”Midlife”;
                    IF(AND($ah8 >=51; $ah8 <=80); ”Mature adulthood”; ”Late adulthood”
                      )
                   )
                )
             )
          )
       )
    I can't figure out why. Help?

    PR

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,088

    Re: IF statement with multiple AND returning #NAME? error

    Possibly a silly question, but do you need to use the Portuguese versions of the function names?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    10-10-2016
    Location
    Coimbra, Portugal
    MS-Off Ver
    2016
    Posts
    86

    Re: IF statement with multiple AND returning #NAME? error

    I don't understand what you mean... I'm using the english version.

    PR

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,088

    Re: IF statement with multiple AND returning #NAME? error

    Quote Originally Posted by Pr0 View Post
    I don't understand what you mean... I'm using the english version.

    PR
    You don't understand why I might think someone in Portugal might be using a Portuguese language version???

    As has already been stated, it's the quotation marks that are incorrect. They need replacing with straight quotes: "Infancy"
    Last edited by AliGW; 05-20-2020 at 01:05 AM.

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,658

    Re: IF statement with multiple AND returning #NAME? error

    I have no idea where this double quotation symbol ”Infancy” comes from, but try to replace they by "Infancy" (This is button next to Enter button) then it should work.
    BTW, this formula is return "infantry" for any value in AH8 those equal or greater than 3, so try to build it again: starting from greatest value: 80
    =IF(AH8>80,"Late adulthood",IF(AH8>=51,"Mature adulthood",......
    Quang PT

  6. #6
    Registered User
    Join Date
    10-10-2016
    Location
    Coimbra, Portugal
    MS-Off Ver
    2016
    Posts
    86

    Re: IF statement with multiple AND returning #NAME? error

    Quote Originally Posted by AliGW View Post
    You don't understand why I might think someone in Portugal might be using a Portuguese language version???

    As has already been stated, it's the quotation marks that are incorrect. They need replacing with straight quotes: "Infancy"
    Dear AliGW, when you said in your first post - Portuguese versions of the function names, I actual thought that you meant portuguese words for IF and AND (which is a silly assumption from me, by the way) and not the quotation marks, which I honestly didn't notice weren't straight ones (and I too don't know where I got them from ). Bottom line: I've misinterpreted you.

    Quote Originally Posted by bebo021999 View Post
    BTW, this formula is return "infantry" for any value in AH8 those equal or greater than 3, so try to build it again: starting from greatest value: 80
    =IF(AH8>80,"Late adulthood",IF(AH8>=51,"Mature adulthood",......
    You're absolutely right - I meant <=3 and not >=3.
    It's all good now. Thank you both.

    PR
    Last edited by Pr0; 05-20-2020 at 01:59 AM.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,088

    Re: IF statement with multiple AND returning #NAME? error

    I wouldn't know how a Portuguese language version handles IF and AND - that was my point. In some foreign languages, these are translated, and the error was consistent with this possibility. Please be aware for the future that members here will not know all language versions inside out (if at all)!!!

+ 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] VLookup Returning Multiple Results within an IF Statement?
    By darin_siemens in forum Excel Formulas & Functions
    Replies: 22
    Last Post: 07-30-2019, 04:09 PM
  2. INDEX MATCH across multiple sheet returning error
    By melvinkoshy in forum Excel General
    Replies: 3
    Last Post: 12-19-2017, 03:16 AM
  3. [SOLVED] Comparing Multiple columns across worksheets and returning a True/False statement
    By RoryK in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-11-2015, 10:33 PM
  4. Replies: 3
    Last Post: 08-16-2014, 05:29 AM
  5. [SOLVED] IF statement returning #VALUE error
    By Christopher135 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-05-2013, 12:59 AM
  6. IF OR statement returning #VALUE! error?
    By Sonny Crockett in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-17-2013, 08:57 AM
  7. ISBLANK statement returning multiple strings
    By Sam Davis in forum Excel General
    Replies: 10
    Last Post: 05-05-2010, 05:23 PM

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