Solved

How can I display the argument type of a cell's SUBTOTAL() function

Posted on 2014-04-10
2
263 Views
Last Modified: 2014-04-10
I have a table the bottom row of which contains formulas for SUBTOTALS. Sometimes it may be a Sum, Average, Minimum or Maximum. I would like to have an adjacent cell with text that tells which of those types is currently selected, Is there a way to extract that information from the cell with the formula?
0
Comment
Question by:BobArnett
2 Comments
 
LVL 21

Accepted Solution

by:
Ejgil Hedegaard earned 500 total points
ID: 39992908
Using VBA code it is possible to read the formula, find the type code in the Subtotal formula and display that in a cell, either the number, or a text.

I think it would be as good to do it the opposite way, and that don't require macro activation.
Make a list with the subtotal types you want to use, and the corresponding type numbers.
Use Data validation to select the type (name), and use a Vlookup to get the number for the subtotal formula.
The list can be placed on another sheet, and use a range name for the data validation input.
Excel require the validation list to be on the same sheet, but not if it is a range name.
See example.
Subtotal-type-select.xlsx
0
 

Author Closing Comment

by:BobArnett
ID: 39992934
I agree, your second idea would fit the best for what I want to do. Thanks for the quick and helpful reply.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

838 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question