+ Reply to Thread
Results 1 to 8 of 8

Using an IF Function with 3 returns?

Hybrid View

  1. #1
    Registered User
    Join Date
    09-04-2014
    Location
    Birmingham
    MS-Off Ver
    2003
    Posts
    3

    Using an IF Function with 3 returns?

    The title probably doesn't explain it well but this is what i have so far but think i may be well out

    This is what i need;

    C49, D49, E49 will show either "Promoter", "Passive" or "Detractor"
    I have already worked that when you do
    =COUNTIF(C49:E49,"Promoter")-COUNTIF(C49:E49,"Detractor")
    it will show a number, which is great

    now i need to add to that so
    Returns of 1 or higher will show the word "Promoter"
    Returns of 0 will show the word "Passive"
    Returns of -1 or less will show the word "Detractor"


    does anyone know how i would amend the more simple

    COUNTIF(C49:E49,"Promoter")-COUNTIF(C49:E49,"Detractor")

    to make it take into account that the cell will show "Promoter", "Passive" or "Detractor" as an end result?
    I can only seem to get it to show "Promoter" as 1 or more... or "Detractor" as 0 or less with the following (but can't seem to work out how to add the 3rd option)

    =IF((COUNTIF(C49:E49,"Promoter")-COUNTIF(C49:E49,"Detractor"))>=0,"Promoter","Detractor")


    Grateful for any help, cheers guys

  2. #2
    Registered User
    Join Date
    09-03-2014
    Location
    Lakewood, Ohio
    MS-Off Ver
    Office 365
    Posts
    12

    Re: Using an IF Function with 3 returns?

    Try this
    =IF((COUNTIF(C49:E49,"Promoter")-COUNTIF(C49:E49,"Detractor"))>0,"Promoter",IF((COUNTIF(C49:E49,"Promoter")-COUNTIF(C49:E49,"Detractor"))<0,"Detractor","Passive"))

  3. #3
    Registered User
    Join Date
    09-04-2014
    Location
    Birmingham
    MS-Off Ver
    2003
    Posts
    3

    Re: Using an IF Function with 3 returns?

    That's brilliant thankyou,
    is there any way to have it so that if the text is blank in all of C49, D49 and E49 it will just be a blank cell or will say N/A?
    otherwise all of my staff will show in the Passive section

  4. #4
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Using an IF Function with 3 returns?

    IF is a boolean function; you choose one of two options pretty much by the way it's designed.

    That said, you just wrap another IF around what already exists to do another test "upstream" of what you have.

    =IF( COUNTIF(C49:E49,"Promoter")+COUNTIF(C49:E49,"Detractor")=0, "", existing_IFs)
    You can have up to seven IFs total wrapped like that in 2003.

  5. #5
    Registered User
    Join Date
    09-04-2014
    Location
    Birmingham
    MS-Off Ver
    2003
    Posts
    3

    Re: Using an IF Function with 3 returns?

    Thanks both of you,
    I didn't realise you could do more than one IF, never had to do that before but now I know I will never forget

  6. #6
    Registered User
    Join Date
    09-03-2014
    Location
    Lakewood, Ohio
    MS-Off Ver
    Office 365
    Posts
    12

    Re: Using an IF Function with 3 returns?

    Glad to help, You can pretty much use as many IFs as you can keep track of mentally.

    Whatever the limit it is worth knowing.. so let's have ben clarify
    Last edited by LiveAptly.com; 09-04-2014 at 03:15 PM.

  7. #7
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Using an IF Function with 3 returns?

    Quote Originally Posted by LiveAptly.com View Post
    Whatever the limit is it is not worth knowing.
    In 2007+ the limit is 64. (Maybe more in 2013?)

    In 2003 or earlier, however, it's seven.

    I had to look up the 2007 value; but the 2003 one is enough of a problem that it's a well-known limitation when constructing booleans in excel.

    Well

    "Well known" to people who hang out on excel help forums answering questions, that is, so that's a pretty serious filter on "well known."

  8. #8
    Registered User
    Join Date
    09-03-2014
    Location
    Lakewood, Ohio
    MS-Off Ver
    Office 365
    Posts
    12

    Re: Using an IF Function with 3 returns?

    Yes, 64 nested functions is a bit more than I can keep track of
    a limit of 6 would be pretty anoying - fortunately I was in my mid teens back in 03 and not too concerned about nested functions

+ 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. Function returns #VALUE
    By sprites in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-21-2013, 04:58 AM
  2. [SOLVED] User defined function returns an error on a standard function used in it.
    By pb48 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-23-2013, 01:35 PM
  3. Sum function returns 0, sum(value(...) returns #value
    By AileenR in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-17-2013, 11:13 PM
  4. [SOLVED] Using ROW function inside of both an Indirect and Index function returns #VALUE
    By xandermacleod in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-11-2012, 06:22 PM
  5. [SOLVED] VBA function returns #NAME?
    By mogens in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-20-2006, 01:10 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