+ Reply to Thread
Results 1 to 7 of 7

Determining which formula a cell should use depending on drop-down criteria

  1. #1
    Registered User
    Join Date
    01-07-2019
    Location
    Gloucestershire, England
    MS-Off Ver
    2016
    Posts
    3

    Determining which formula a cell should use depending on drop-down criteria

    Hi Guys,

    I’m unsure whether this is at all possible but ideally I would like a sum of a cell to be determined by what drop-down box is selected in another cell… i.e. a different sum range for each drop-down option. Is this do-able?

    I have read about array formulas and have managed to get it to work separately E.g. {=SUM(SUMIF(G44,F29,D28:D30))} + {=SUM(SUMIF(G45,F29,D28+D30) (I want to exclude D29 in this instance) but cannot combine the two options as one formula so that it uses either depending on the drop-down selected (F29 being the cell with the data validation, G44 and G45 being the two drop down options).

    What’s the best way to work this?

    Many thanks,

    Becky

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,705

    Re: Determining which formula a cell should use depending on drop-down criteria

    Welcome to the Forum RebeccaD1997!

    It is easy enough to have a formula like this

    =IF(F29="Option 1",SUMIF(G44,F29,D28:D30),IF(F29="Option 2",SUMIF(G45,F29,D28,D30),""))

    replace Option 1 and Option 2 with the actual values in the dropdown.

    Besides that I see some problems in the formula you showed. It might give the answer you are expecting but it is a very roundabout way of getting it. Can you describe what you want that formula to do?
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Determining which formula a cell should use depending on drop-down criteria

    First of all, you might be able to do this with SUMIFS instead of an array formula or possibly even just plain SUM. We'll have to see how the data is laid out and need a bit more explanation as to where the drop downs come from and what the rule is for determining which drop downs go with which ranges to sum.

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  4. #4
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Determining which formula a cell should use depending on drop-down criteria

    how about:

    =if(F29=G44,sum(D28:D30),sum(D28,D30))
    1. Click on the * Add Reputation if you think this helped you
    2. Mark your thread as SOLVED when question is resolved

    Modytrane

  5. #5
    Registered User
    Join Date
    01-07-2019
    Location
    Gloucestershire, England
    MS-Off Ver
    2016
    Posts
    3

    Re: Determining which formula a cell should use depending on drop-down criteria

    Didn't know about the advanced options! Please find attached worksheet - The idea being if F29 (payment type) is "add to loan", D31 (Revised Mortgage Balance) will add D28:D30 and if it set to "Own Funds", D31 (Revised Mortgage Balance) will only add D28 & D30.

    Hope this makes sense!

    Many thanks for your help in advance guys.

    Becky
    Attached Files Attached Files

  6. #6
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Determining which formula a cell should use depending on drop-down criteria

    Please try at D31

    =SUM(D28:D30)-(LEFT(F29)="o")*D29

  7. #7
    Registered User
    Join Date
    01-07-2019
    Location
    Gloucestershire, England
    MS-Off Ver
    2016
    Posts
    3

    Re: Determining which formula a cell should use depending on drop-down criteria

    Thank you so much - worked perfectly!

+ 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: 06-14-2016, 07:50 PM
  2. [SOLVED] Part 2 - a formula that says yes or no depending upon a range of drop down boxes
    By mfairhurst1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-14-2013, 09:36 AM
  3. Formula to calculate totals depending on Drop Down Menu
    By Hadda in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-17-2013, 09:41 PM
  4. Replies: 4
    Last Post: 09-29-2010, 04:36 AM
  5. Entering a formula depending on criteria of cell
    By drgogo in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 03-10-2010, 11:14 AM
  6. Determining if sheet has existing data and further actions depending on it
    By xyz123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-07-2008, 10:33 AM
  7. Drop Down Lists - Depending on other cell values
    By LaDonna1024 in forum Excel General
    Replies: 6
    Last Post: 10-23-2008, 03:20 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