Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2014-04-10
2
Medium Priority
?
288 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 23

Accepted Solution

by:
Ejgil Hedegaard earned 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
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…

636 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