+ Reply to Thread
Results 1 to 6 of 6

Multiple conditions formula

  1. #1
    Registered User
    Join Date
    12-23-2017
    Location
    England
    MS-Off Ver
    2016
    Posts
    37

    Multiple conditions formula

    I'm trying to write a formula that will allow me to select 2 conditions from drop-down lists in 2 columns, and then based on the two options selected, select a correpsonding cell. THis cell is then to be multiplied by it's adjacent cell to give a result.
    At the moment I've tried to do this with a multiple "IF AND" formula but I can't work out whether that is even viable to be honest! This is what I've written and it returns an error statement, however I'm struggling to understand why that is:

    =IF(AND(G3="Blue",H3="Square"),(I3*C$41),IF(AND(G3="Blue",H3="Circle"),(I3*C$47)),IF(AND(G3="Green",H3="Square"),(I3*C$42),IF(AND(G3="Green",H3="Circle"),(I3*C$48)),IF(AND(G3="Red",H3="Square"),(I3*C$43),IF(AND(G3="Red",H3="Circle"),(I3*C$49)),IF(AND(G3="Yellow",H3="Square"),(I3*C$44),IF(AND(G3="Yellow",H3="Circle"),(I3*C$50)),IF(AND(G3="Orange",H3="Square"),(I3*C$45),IF(AND(G3="Orange",H3="Circle"),(I3*C$51)))

    In the example above, I have 2 drop-down lists, one for colours (Blue, Green, Red, Yellow and Orange) and one for shapes (Square and Circle). So if in column 1 I select "Green" and in column 2 I select "Circle", I want it to add the result from cell C48 and then multiply it by the adjacent cell in column I.

    I suspect that there's probably a much easier & 'cleaner' way of presenting these results, but it's slightly beyond my current knowledge. Any help that anyone can offer would be fantastic & much appreciated.

    Thanks,
    Jon

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Multiple conditions formula

    1. Always better to upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    2. looking at your formula quickly (more to follow), looks like you may be closing your 2nd IF too soon?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Multiple conditions formula

    Quick way to check for opening/closing brackets...
    =IF(AND(G3="Blue",H3="Square"),(I3*C$41)
    ,IF(AND(G3="Blue",H3="Circle"),(I3*C$47))
    ,IF(AND(G3="Green",H3="Square"),(I3*C$42)
    ,IF(AND(G3="Green",H3="Circle"),(I3*C$48))
    ,IF(AND(G3="Red",H3="Square"),(I3*C$43),
    IF(AND(G3="Red",H3="Circle"),(I3*C$49))
    ,IF(AND(G3="Yellow",H3="Square"),(I3*C$44)
    ,IF(AND(G3="Yellow",H3="Circle"),(I3*C$50))
    ,IF(AND(G3="Orange",H3="Square"),(I3*C$45)
    ,IF(AND(G3="Orange",H3="Circle"),(I3*C$51)))

    A quick look shows that you have closed the BOLDED ifs, you can tell ny the 2 )) at the end of the row

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Multiple conditions formula

    hmm also, looks like you could probably use INDEX/MATCH for this, but a sample WB will offer better suggestions

  5. #5
    Registered User
    Join Date
    12-23-2017
    Location
    England
    MS-Off Ver
    2016
    Posts
    37

    Re: Multiple conditions formula

    Quote Originally Posted by FDibbins View Post
    Quick way to check for opening/closing brackets...
    =IF(AND(G3="Blue",H3="Square"),(I3*C$41)
    ,IF(AND(G3="Blue",H3="Circle"),(I3*C$47))
    ,IF(AND(G3="Green",H3="Square"),(I3*C$42)
    ,IF(AND(G3="Green",H3="Circle"),(I3*C$48))
    ,IF(AND(G3="Red",H3="Square"),(I3*C$43),
    IF(AND(G3="Red",H3="Circle"),(I3*C$49))
    ,IF(AND(G3="Yellow",H3="Square"),(I3*C$44)
    ,IF(AND(G3="Yellow",H3="Circle"),(I3*C$50))
    ,IF(AND(G3="Orange",H3="Square"),(I3*C$45)
    ,IF(AND(G3="Orange",H3="Circle"),(I3*C$51)))

    A quick look shows that you have closed the BOLDED ifs, you can tell ny the 2 )) at the end of the row
    That worked great, thank you very much for your help. Noting your point 1 in your first email, I will ensure that I do that in future. Thanks again.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Multiple conditions formula

    Thanks for the feedback. Did you get this all resolved?

+ 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. Replies: 2
    Last Post: 01-14-2016, 03:53 PM
  2. [SOLVED] IF (AND) Formula with Multiple Conditions
    By arpanpanchal in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-06-2015, 02:55 AM
  3. [SOLVED] I need help with SUM formula with multiple conditions
    By arkadd61 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-28-2014, 10:45 PM
  4. [SOLVED] If Formula using multiple conditions
    By DawsonG in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-05-2013, 01:22 PM
  5. 3 multiple conditions with multiple criteria formula help
    By rmnk101190 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-29-2013, 04:37 PM
  6. [SOLVED] Syntax for formula that uses multiple conditions inside of multiple IF statements
    By njmiller31 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-02-2013, 11:55 AM
  7. IF formula with multiple conditions
    By jomili in forum Excel General
    Replies: 5
    Last Post: 09-12-2011, 04:50 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