+ Reply to Thread
Results 1 to 9 of 9

Multiple conditions for IF Function

  1. #1
    Registered User
    Join Date
    03-28-2016
    Location
    Coventry
    MS-Off Ver
    Microsoft 365
    Posts
    65

    Multiple conditions for IF Function

    Hi Guys & Girls,


    Got one that is causing me a few headaches... I have cell which needs to generate a value dependant on two types of style and two lots of categories. What I am looking for is a formula to recognise the following..


    Cell H23 has two options - W or D which is a data validation drop down list.

    Once W or D is selected, Cell A5 then has an INDIRECT data validation of categories to choose from which are based on the initial selection of W or D, which again is a drop down list to choose from.

    Once the category in Cell A5 has been selected, then this will generate a value in Cell L4 which has an IF formula in it which states the correct numerical value based on the selected W or D and the relevant category selected in A5.

    The problem I am having is I cant work out how to make the formula in Cell L4 recognise both the selections previously made in H23 & A5.

    Can anyone point me in the right direction??

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,141

    Re: Multiple conditions for IF Function

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    03-28-2016
    Location
    Coventry
    MS-Off Ver
    Microsoft 365
    Posts
    65

    Re: Multiple conditions for IF Function

    Thanks Glenn,

    I have created a workbook with the required data (the other main workbook has too many confidential bits to remove) You will see the initial formulas I have inserted into cells representing V1 - V5

    I have populated a table below with the required results for each category for W & D

    I just need the V1 - V5 boxes to automatically update with the correct values from the value data table based upon the type selection and then the category for that type which has been selected.

    Many thanks
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    03-28-2016
    Location
    Coventry
    MS-Off Ver
    Microsoft 365
    Posts
    65

    Re: Multiple conditions for IF Function

    Just noticed their is a copy/paste error with the formulas in V1 - V5 but I am sure you will get my drift in terms of the requirements. My current basic formula doesn't provide me with the correct data anyway

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,361

    Re: Multiple conditions for IF Function

    In G5

    =INDEX($D$15:$H$18,MATCH($D$8,$C$15:$C$18,0),MATCH($F$5,$D$14:$H$14,0))

    Copy to there cells and change Highlighted reference to appropriate "Vn" cell reference

    You could then add IF condition to test for D or W

    =IF (D5="D",INDEX($D$15:$H$18,MATCH($D$8,$C$15:$C$18,0),MATCH($F$5,$D$14:$H$14,0)), INDEX for W table)

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,141

    Re: Multiple conditions for IF Function

    Or this (after removing some trailing spaces after V1 in your data table)

    =IFERROR(IF($D$5="D",INDEX($D$15:$H$18,MATCH($D$8,$C$15:$C$18,0),MATCH(F5,$D$14:$H$14,0)),IF($D$5="W",INDEX($D$21:$H$24,MATCH($D$8,$C$21:$C$24,0),MATCH(F5,$D$20:$H$20,0)),"")),"")
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    03-28-2016
    Location
    Coventry
    MS-Off Ver
    Microsoft 365
    Posts
    65

    Re: Multiple conditions for IF Function

    Thanks Gents! Problem Officially solved!

    This is by far the greatest Excel forum on the internet!

  8. #8
    Registered User
    Join Date
    01-19-2017
    Location
    Michigan
    MS-Off Ver
    2013
    Posts
    92

    Re: Multiple conditions for IF Function

    Please mark the thread as solved through the thread tools drop down if your initial question has been answered. Thank you.

  9. #9
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Multiple conditions for IF Function

    Xandler, Do you really happy ??? I can give you more dynamic formula which will make you much happy ... Imagine you sample type more than 2 means 8 or 9 or much more then ????

    You Can try

    First make a helper column

    B14
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Drag down..

    G6
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Paste the same formula in other cells.

    Check the attached file.
    Attached Files Attached Files
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

+ 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] IF function with multiple conditions
    By rlowry in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-13-2017, 01:04 PM
  2. If function with multiple conditions
    By Maddie77 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-19-2016, 08:59 AM
  3. IF function with multiple conditions
    By mikee15 in forum Excel General
    Replies: 2
    Last Post: 05-21-2014, 11:20 AM
  4. IF(AND function) help with multiple conditions
    By brose99 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-15-2012, 06:00 PM
  5. If Then function with Multiple conditions
    By DaBrot791 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-07-2012, 04:28 AM
  6. IF Function - Multiple Conditions
    By jdavidson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-11-2007, 12:10 PM
  7. Looking for a function for multiple conditions
    By MrSales in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-16-2007, 03:27 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