+ Reply to Thread
Results 1 to 17 of 17

How to use If functions for 3 criteria

  1. #1
    Forum Contributor
    Join Date
    12-06-2015
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    513

    How to use If functions for 3 criteria

    Dear all

    I would like to know if i have the following criteria

    a) Adult price at $10
    b) Child perice at $15
    c) Buyout price at $100
    d) per unit , total costs of $100, and divided by the number of pax



    a) - c) when select the cost will be as stated. If client select d) Per unit, the cost will be divided by number of persons
    Attached Files Attached Files

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

    Re: How to use If functions for 3 criteria

    Three of us took the time to offer help in your last thread. Please do us the courtesy of a reply if you are expecting to receive further help here. We are all unpaid volunteers.
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    12-06-2015
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    513

    Re: How to use If functions for 3 criteria

    Dear Ali

    I hope i did what you told me..

    My apology for not fulfilling the rules

    Eric

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

    Re: How to use If functions for 3 criteria

    No - I was not asking for rep points. I was asking for an acknowledgement of the help offered in your last two threads, actually. You have just left them without going back and saying whether or not the solution worked. It’s not a rule, it’s just common courtesy.

  5. #5
    Forum Contributor
    Join Date
    12-06-2015
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    513

    Re: How to use If functions for 3 criteria

    Aligw

    I have thanks all people who answered my thread.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,981

    Re: How to use If functions for 3 criteria

    Thank you. Please don't take those who help here for granted in future.

    I will have a look at your problem now.

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

    Re: How to use If functions for 3 criteria

    Try this:

    =ROUND(VLOOKUP(D12&"*",$A$11:$B$14,2,0)/IF(D12="Buyout",$E$11,1),0)

  8. #8
    Forum Contributor
    Join Date
    12-06-2015
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    513

    Re: How to use If functions for 3 criteria

    dear Aligw

    It works thanks

    But i do not understand


    I was trying myself by using If + and ... or even choose + If.

    Because, there may be some more will not be required to divide by the no of pax,i.e E11

    I thought we would have a range to list out all the possible "word"that do not need to divide the no of pax


    Is there any?!

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,981

    Re: How to use If functions for 3 criteria

    I don't have a clue what you are asking me, sorry. However, you can add items to the lookup list. Using nested IF statements is rarely, if ever, the most efficient solution.

    Maybe you want this:

    =ROUND(VLOOKUP(D12&"*",$A$11:$B$14,2,0)/IF(OR(D12="Adult",D12="Child"),1,$E$11),0)

  10. #10
    Forum Contributor
    Join Date
    12-06-2015
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    513

    Re: How to use If functions for 3 criteria

    Dear Aligw

    Thanks a lot

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,981

    Re: How to use If functions for 3 criteria

    You're welcome.

  12. #12
    Forum Contributor
    Join Date
    12-06-2015
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    513

    Re: How to use If functions for 3 criteria

    Dear Aligw

    I have found Ifs, as i am using 2016

    =IFS(D15="adult",B14,D15="Buyout",B14,D15="Child",B14,TRUE,B14/$E$11)

    But i am still looking for solution that can be use for 2010 ( as my colleauge are using this version)

    I also saw one of the method, which they can refer to a range of the criteria .. something a combination of "choose"and "if"
    as an alternative for Nest If

    Eric
    Attached Files Attached Files

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,981

    Re: How to use If functions for 3 criteria

    I have given a solution that works in Excel 2010. Why don't you use it? It's ridiculous trying to do this with nested IF statements - it will be a nightmare going forward - my solution is easily scalable by extending the lookup range.

  14. #14
    Forum Contributor
    Join Date
    12-06-2015
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    513

    Re: How to use If functions for 3 criteria

    Dear Aligw

    As i may have a list of "criteria "

    I do not understand your formula... i am very new in Excel

    Eric

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,981

    Re: How to use If functions for 3 criteria

    Which is precisely why you should NOT be using nested IFs! If you stubbornly insist on using them and reject my solution, then you will never learn what Excel can do and, frankly, there's no point in asking us to advise you.

    Have a look at the attached. Add some more items and prices to the price list on the left, then add one of the new items to cell D18 and see what happens.

    If you need the formula explaining, then say so.
    Attached Files Attached Files

  16. #16
    Forum Contributor
    Join Date
    12-06-2015
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    513

    Re: How to use If functions for 3 criteria

    Dear Aligw

    I found that your formula can keep adding "items"
    =IF(D12="","",ROUND(VLOOKUP(D12&"*",$A$11:$B$50,2,0)/IF(OR(D12="Adult",D12="Child",D12="Buyout",D12="Another"),1,$E$11),0))

    It works

    I think the problem solved

    eric

  17. #17
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,981

    Re: How to use If functions for 3 criteria

    That should NOT work based on what you said about Buyout in the first place.

    You would be far better off understanding the formula before trying to update it.

    The OR clause should include ONLY the items that are priced as is. Anything that is divided by the number of people (pax as you call it) should NOT be in the OR statement.

    I doubt the problem is solved - but if you are happy to walk away without understanding the solution, then that's fine. However, for completeness (and for anyone else reading this), here's a breakdown:

    =IF(D12="","",

    If D12 is blank, return nothing (blank).

    VLOOKUP(D12&"*",$A$11:$B$50,2,0)

    Lookup D12 in the range A11:A50 and return what is in the cell to the right of it (in B11:B50).

    IF(OR(D12="Adult",D12="Child")

    If D12 is EITHER Adult OR Child ...

    /... 1, ...)

    divide it by 1 (in other words leave it as it is).

    / ... $E$11)

    Anything that isn't one of these two is divided by the value in E11 (3).

    ROUND(... ,0)

    The result is rounded to a whole number.

+ 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 functions/using 2 criteria
    By Gaellus in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-19-2016, 06:54 AM
  2. [SOLVED] Multiple criteria lookup functions
    By Wizards in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-07-2014, 01:06 AM
  3. run functions based on criteria
    By aballoonflies in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-03-2013, 09:39 PM
  4. Automated Min Max functions on multiple criteria
    By apetlu in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-04-2012, 02:57 PM
  5. How to use the criteria in basic functions
    By matt3m in forum Excel General
    Replies: 6
    Last Post: 08-08-2011, 11:15 AM
  6. Two criteria SumIf functions?
    By pyzikchr in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-23-2007, 11:56 AM
  7. [SOLVED] use of vlookup and IF functions on certain criteria
    By adi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-18-2006, 11:35 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