+ Reply to Thread
Results 1 to 3 of 3

Create a function that can be decided based on drop down selection

  1. #1
    Registered User
    Join Date
    11-23-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1

    Question Create a function that can be decided based on drop down selection

    I want to Sum or Average or other function based on the selection in another cell. I have a Cell D36 that contains the formula =INDIRECT(D35) & (D30:D34), D35 contains the reference $B$36, that cell is a drop down containing the possible options for Average/Sum/etc. I would like the result to a be a formula like =Sum(D30:D34). Instead I get the results as an array with a $Spill error since there is data below when I only need the result of the formula.

    Any help would be appreciated.
    Last edited by rknowledge; 10-30-2021 at 08:19 AM.

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

    Re: Sum or Average or Other based on the selection in another cell.

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. As you are new here, I have done it for you this time.)
    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 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,647

    Re: Sum or Average or Other based on the selection in another cell.

    There are instructions at the top of the page explaining how to attach your sample workbook.

    A good sample workbook has just 10-20 rows of representative data. It also has expected results mocked up, relevant cells highlighted and a few explanatory notes.

    Administrative Note:

    Members will tailor the solutions they offer to the version of Office (Excel) that you have. Please check that your forum profile is up-to-date in this respect. If you aren't sure, in Excel go to File | Account and report what it says below the MS logo at the top of that page. If your version is for Mac, please also state this. Thanks.

+ 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] How can i change this logic to be more versatile?
    By cubangt in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-06-2021, 06:08 PM
  2. Right function, Left function, Mid function to extract values in column A
    By bjnockle in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 06-14-2020, 03:14 PM
  3. Replies: 2
    Last Post: 11-29-2018, 03:10 AM
  4. Calling function inside function. (aka nested function)
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-02-2015, 05:58 AM
  5. Replies: 16
    Last Post: 12-02-2014, 03:38 PM
  6. Using a versatile GETPIVOTDATA function
    By bakes1 in forum Excel General
    Replies: 1
    Last Post: 02-23-2008, 02:17 AM
  7. Desire Versatile Alphanumeric Extractor From Any String
    By bxc2739 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-25-2007, 04:12 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