Reply
Fri 4 Jul, 2003 10:47 am
Hi - I just found out about this site
I would appreciate some help with an excel problem I have
I want to be able to accumulate sums in a column based on a test for certain items in another column. An example:
I have two columns - one with numbers and one with text. It is a budget worksheet and I want to be able to tell how much (and for what) is in the miscellaneous column.
Miscellaneous description
$100.00 food
$50.00 gas
$25.00 entertainment
$25.00 food
$10.00 gas
$5.00 entertainment
total
$215.00
I want to add up all the "food" (etc) items based on a test in the description column such as:
If the item in the description column equals "food" then take the $100.00 and put it somewhere so it can be added up into a grand total for food (ie $125.00)
..and so on. The total of these individual items should prove to the total in the miscellaneous column. If there is anyone out there that can help I would certainly appreciate it.
Warmest regards
Daniel
hmm, my Excel book is at work, and I ain't working for 5 days. If nobody answers this for you please bump it around wednesday and I'll scour the good ole book for ya.
Hi Daniel! :-D
It's a 2-step process.
First, you need to get the computer to total everything by category (food, etc.) then you need to plug the totals in elsewhere.
The first thing is to make a separate column and use this formula all the way down: =IF(B2="food",A2,0) (B2 is the cel where the description is; A2 is where the number is) What this formula does is, it creates a logical test. If the description is food, then use the number. If not, put in a zero. Copy this formula all the way down by placing your cursor in the lower right corner of the cel where the formula is. See it turn into a black cross? Now click and drag down, as far as you need to go.
Next, sum the bottom of your new column. We'll call this the sum cel.
Now, to get that total in with your other food calculations, you need to take the sum cel and plug it in. Since the sum cel can vary, and human error might make you transpose numbers, you don't want to just retype the total. Instead, in the cel where you want the sum cel to be, type =. Then, physically click the sum cel and hit enter. It doesn't even matter if the sum cel is on a different worksheet. If it is on a different worksheet, the formula for getting the sum cel where you want it will look like this: ='WorksheetName'!B71, where WorksheetName is the name of the worksheet where the sum cel exists, and B71 is the specific cel for the sum cel. Note you must have single quotes (') around the worksheet name and an exclamation point (!) before the cel.
Add this figure to your other food totals and you'll get your new total.
thanks for your solution!!!!
Thanks very much for your solution......it worked great. I added a "proof" sum of all the columns so i could be sure i didn't leave something out and everything works great......its amazing how much i classify as miscellaneous though... thanks VERY much again
Daniel
And thatnk you jespah for saving me from opeing a huge book. My company is forcing me to read a huge access book so an excel book would have been more tedium.
My pleasure! On both accounts! :-D