+ Reply to Thread
Results 1 to 10 of 10

If function, many ifs but one or two outcome?

  1. #1
    Registered User
    Join Date
    04-14-2010
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    21

    If function, many ifs but one or two outcome?

    Hi, been searching high and low but didn't find what I need...hopefully some experts here can help me out.

    Is it possible for Excel If to perform as such;

    A1 cell to display 'INCOME' when B1 shows either any of these (Salary, Cash Deposit, Cashback, Dividend, Interests)
    A1 cell to display 'EXPENSE' when B1 shows either any of these (Insurance, Dining Out, Groceries, Household)

    Thanks in advance and happy new year!!

  2. #2
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: If function, many ifs but one or two outcome?

    Quote Originally Posted by axangec View Post
    Is it possible for Excel If to perform as such;
    A1 cell to display 'INCOME' when B1 shows either any of these (Salary, Cash Deposit, Cashback, Dividend, Interests)
    A1 cell to display 'EXPENSE' when B1 shows either any of these (Insurance, Dining Out, Groceries, Household)
    Does this do what you want (entered into A1):
    Please Login or Register  to view this content.
    But if those are all of the only possible values for B1, perhaps you can simplify it, to wit:

    =IF(OR(B1={"Salary","Cash Deposit","Cashback","Dividend","Interests"}),"INCOME","EXPENSE")
    Last edited by joeu2004; 01-08-2016 at 05:18 AM. Reason: typo: misplaced "})"

  3. #3
    Registered User
    Join Date
    04-14-2010
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    21

    Re: If function, many ifs but one or two outcome?

    Thanks for the quick response! I didn't know it can be use this way.

    However, only INCOME will appear for either (Salary, Cash Deposit, Cashback, Dividend, Interests) but it shows nothing when I key in any of (Insurance, Dining Out, Groceries, Household) in B1 cell...

    =IF(OR(B1={"Salary","Cash Deposit","Cashback","Dividend","Interests"}),"INCOME",
    IF(OR(B1={"Insurance","Dining Out","Groceries","Household","EXPENSE"}), ""))

  4. #4
    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 function, many ifs but one or two outcome?

    It works OK for me as indeed does Joeu's shorter version.

    If you claim it's not working for you then can I suggest you upload the workbook you're using in which you've entered the formula.

    Are you sure you're not entering any leading or trailing spaces?
    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.

  5. #5
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: If function, many ifs but one or two outcome?

    Seems you have a typo =IF(OR(B1={"Salary","Cash Deposit","Cashback","Dividend","Interests"}),"INCOME",
    IF(OR(B1={"Insurance","Dining Out","Groceries","Household"}),"EXPENSE"),"")

  6. #6
    Registered User
    Join Date
    04-14-2010
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    21

    Re: If function, many ifs but one or two outcome?

    Thanks and sorry for the late reply.

    I have input the formula and gotten a 'You've entered too many arguments for this function.'

    Please Login or Register  to view this content.
    Only when I get rid of the very last ,"" then it works.

    Please Login or Register  to view this content.
    But when B1 cell is empty, it returns a 'FALSE' on A1 cell.

    Is there anything which I have done wrongly? Thanks a lot!

  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 function, many ifs but one or two outcome?

    Hi,

    It seems there was a parentheses in the wrong place. Try

    =IF(OR(B1={"Salary","Cash Deposit","Cashback","Dividend","Interests"}),"INCOME",IF(OR(B1={"Insurance","Dining Out","Groceries","Household"}),"EXPENSE","Unknown item"))

  8. #8
    Registered User
    Join Date
    04-14-2010
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    21

    Re: If function, many ifs but one or two outcome?

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    It seems there was a parentheses in the wrong place. Try

    =IF(OR(B1={"Salary","Cash Deposit","Cashback","Dividend","Interests"}),"INCOME",IF(OR(B1={"Insurance","Dining Out","Groceries","Household"}),"EXPENSE","Unknown item"))
    Thanks Richard!! It works now!!

  9. #9
    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 function, many ifs but one or two outcome?

    Glad to have contributed and thanks for the rep - which is really due to Pepe

  10. #10
    Registered User
    Join Date
    04-14-2010
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    21

    Re: If function, many ifs but one or two outcome?

    Quote Originally Posted by Richard Buttrey View Post
    Glad to have contributed and thanks for the rep - which is really due to Pepe
    I added rep for Pepe too, it's people like you guys that make this forums a wonderful place

+ 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 Function returning text as outcome
    By pedro90 in forum Excel General
    Replies: 9
    Last Post: 12-02-2014, 01:06 PM
  2. [SOLVED] outcome of CONCATENATE function
    By clareleeder in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-20-2013, 01:17 PM
  3. [SOLVED] why not the same outcome?
    By goofer in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-02-2013, 08:17 PM
  4. [SOLVED] If function Multiple logic tests each with its own outcome. How do I write it.
    By markDuffy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-16-2013, 04:29 PM
  5. Linking the outcome of an IF function to a vlookup.
    By Colin86 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-16-2013, 04:37 PM
  6. if outcome is less then zero
    By jtwork in forum Excel General
    Replies: 3
    Last Post: 02-21-2007, 11:33 AM
  7. Replies: 5
    Last Post: 01-05-2006, 05:40 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