+ Reply to Thread
Results 1 to 7 of 7

If Condition Formula based on values from dropdown

  1. #1
    Forum Contributor
    Join Date
    06-05-2014
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    155

    If Condition Formula based on values from dropdown

    Hi All,

    Need your help and support please..

    I have data like the attached.. column C has drop down list and column A and B has values. I am trying to write an IF condition formula .. If “X” is selected from the dropdown in column C, then it should be column B – column A. the formula for that is
    Please Login or Register  to view this content.
    .

    Similarly If “Y” is selected from the dropdown in column C, then it should be column A – column B. The formula for that is
    Please Login or Register  to view this content.
    Both these formulas works separately but doesn’t works when combined.. I tried with
    Please Login or Register  to view this content.
    but its not working..

    Attached is the sample data.. Please help..
    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,460

    Re: If Condition Formula based on values from dropdown

    The parenthesis was wrong. In C2 copied down:

    =IF(C2="X",B2-A2,IF(C2="Y",A2-B2))
    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 Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,496

    Re: If Condition Formula based on values from dropdown

    you might want to adjust it to this... =IF(C4="X",B4-A4,IF(C4="Y", A4-B4,""))
    and drag down.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  4. #4
    Forum Contributor
    Join Date
    06-05-2014
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    155

    Re: If Condition Formula based on values from dropdown

    Quote Originally Posted by AliGW View Post
    The parenthesis was wrong. In C2 copied down:

    =IF(C2="X",B2-A2,IF(C2="Y",A2-B2))
    Thank you so much.. Its works perfectely fine ..

  5. #5
    Forum Contributor
    Join Date
    06-05-2014
    MS-Off Ver
    Microsoft Office Professional Plus 2016
    Posts
    155

    Re: If Condition Formula based on values from dropdown

    Quote Originally Posted by Sam Capricci View Post
    you might want to adjust it to this... =IF(C4="X",B4-A4,IF(C4="Y", A4-B4,""))
    and drag down.
    Thank you so much.. Its working fine ..

  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,460

    Re: If Condition Formula based on values from dropdown

    Glad to have helped.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank those who have helped you by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

  7. #7
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,496

    Re: If Condition Formula based on values from dropdown

    Glad we could help! And thank you for the rep!

+ 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] Need a formula to condition a cell based on other cell values
    By joshkirby123 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-15-2020, 10:30 AM
  2. Replies: 2
    Last Post: 03-27-2018, 08:32 AM
  3. [SOLVED] Formula to show unique values and display horizontally based on condition
    By Rygor in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-10-2017, 01:34 AM
  4. Replies: 14
    Last Post: 08-04-2016, 02:18 PM
  5. [SOLVED] formula required to list cell values based on condition
    By kiranpat in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-15-2014, 04:54 AM
  6. Replies: 3
    Last Post: 01-08-2014, 03:56 PM
  7. [SOLVED] Cut A Row Paste It On First Empty Row In Another Sheet Based on Condition DropDown
    By Bookstr in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-23-2013, 11:08 PM

Tags for this Thread

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