Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-14-2012, 09:37 AM
Jennifer Pannell Jennifer Pannell is offline Auto sum - excel Windows XP Auto sum - excel Office 2007
Novice
Auto sum - excel
 
Join Date: Mar 2012
Posts: 2
Jennifer Pannell is on a distinguished road
Default Auto sum - excel

Newbie here with question. Excel 2007, have 1 column with 10 rows of numbers. I want an auto sum of the column, but only total the ones I have highlighted yellow or any color. Example 1 column, 10 rows, each row has the number 10. Only 7 of the 10 are highlighted a color so I want the auto sum to come out total 70, not auto sum 100.
Reply With Quote
  #2  
Old 03-14-2012, 09:45 AM
Colin Legg's Avatar
Colin Legg Colin Legg is offline Auto sum - excel Windows 7 32bit Auto sum - excel Office 2010 32bit
Expert
 
Join Date: Jan 2011
Location: UK
Posts: 369
Colin Legg will become famous soon enough
Default

Hi Jennifer,

Excel can't sum by colour very well. In Excel 2007, you could use the autofilter to filter the column by colour and have a subtotal. The subtotal will give you the sum of only the cells that are visible.

If you don't want to use the autofilter then you would have to write some VBA code to create your own function to sum by colour. Even then, the VBA function would have issues because it wouldn't automatically recalculate as soon as the colour of a cell is changed, so it's not an attractive solution in my opinion.

Instead of using colours, a better idea would be to use an adjacent column and to use it to 'flag' which cells you want to sum. For example, suppose you want to sum some of the numbers in A2:A11. In column B, you could put a 1 in B3 and B5 and then use this formula to get the sum:

=SUMIF(B2:B11,1,A2:A11)

This will only sum the numbers which have a 1 on the same row in column B (ie A3 and A5). As you change the 1 flags in column B, the SUMIF formula will automatically calculate the revised total.
__________________
Colin

RAD Excel Blog
Reply With Quote
  #3  
Old 03-14-2012, 11:00 AM
Jennifer Pannell Jennifer Pannell is offline Auto sum - excel Windows XP Auto sum - excel Office 2007
Novice
Auto sum - excel
 
Join Date: Mar 2012
Posts: 2
Jennifer Pannell is on a distinguished road
Default

Great ideal about the adjacent column and to use it to 'flag' the highlighted ones. That will solve my issue - THANKS!!!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto referencing SharkAttack Word 5 02-17-2013 07:09 PM
Auto Updating and Using Excel as Source Shugs81 PowerPoint 0 02-21-2012 03:25 AM
Help With Auto-Responder Please nejo Outlook 4 06-13-2011 05:09 PM
Pasting HTML into Excel (height auto-adjust) c-tran Excel 0 03-11-2010 07:30 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:33 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft