Excel 2010 - Calculate a total value based on text selection

Posted on 2013-11-21
Medium Priority
Last Modified: 2013-11-22
Users will select from a data validation list (6 choices) in blocks of rows (in column C). Eg; rows 8 -18, 23-43, 48-60, 66-83.  

I need to assign a different value to each of the choices (say 1 to 6) and calculate the total value for each block of rows & display that total in column D, next row down, eg; total for rows 8-18 will display in D19.

I have similar requirements are on other worksheets in same file, just the blocks of rows differ.

Your help will be greatly appreciated.
Question by:kazmdav
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 39665237
It would be helpful to understand and test if you upload a sample workbook. You may upload something fake.

Expert Comment

ID: 39665246
Either explain in greater detail your logic or upload a file. I have no idea what you need to do...

Accepted Solution

samrad1 earned 2000 total points
ID: 39665392
Hey! I took at stab at what i think you mean, though I'm just guessing so hopefully it helps. Used data validation and a smaller set of rows in the file attached. I assign numbers to the value to the left of the data validation based on a if statement.

The IF formula in column A refers to a list of possible data validation responses in E3:E5 :
=IF(B1=$E$3,1,IF(B1 = $E$4, 2,IF(B1=$E$5,3,"")))

The group total then adds up the values returned by the respective IF formulas.

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.


Author Comment

ID: 39665418
Thanks samrad1, it' s spot on. Works great!  Thanks for your speedy response too.

Author Closing Comment

ID: 39665422
Love the initiative!
LVL 81

Expert Comment

ID: 39670653
I realize that the question has already been answered, but if you would like to avoid using an auxiliary column for the IF formulas, then consider array-entering the following for your total:

The above formula uses the workbook posted by samrad1, but I added numeric scores for the dropdown choices in cells F3:F5.

The attached workbook is samrad1's workbook with his IF formulas modified to use values in F3:F5. I put the array-entered formulas in D6 and D12. You can see that they return the same results as the sum of the IF formulas.


Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Manually copying shapes and their assigned macros one by one to a new location can be tedious, but if you use the Excel utility workbook attached to this article, the process will be much quicker and easier.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

621 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