I have seen it somewhere but unable to recall how to do. In Gray area of attached ws, I am looking for a countif/sumif based on cell OR font color.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Color based Countif/Sumif (Excel 2003)
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Color based Countif/Sumif (Excel 2003)
- This topic has 19 replies, 2 voices, and was last updated 15 years, 10 months ago.
Viewing 2 reply threadsAuthorReplies-
WSHansV
AskWoody LoungerAugust 19, 2009 at 12:33 am #1173988See Color Functions In Excel on Chip Pearson’s website.
-
WSprasad
AskWoody LoungerAugust 19, 2009 at 1:30 am #1173993See Color Functions In Excel on Chip Pearson’s website.
Hans, I have gone through the site before disturbing you. I thought, I missed something and visited again on your direction, but failed to get a proper solution. Actually, I am looking for a formula instead of Code and getting #Name error on applying given formula. Am i missing something OR some additional utility is required? I am not sure.
-
WSHansV
AskWoody LoungerAugust 19, 2009 at 1:56 am #1173996The web page I referred you to contains a set of VBA functions that can be used in worksheet formulas to work with colors. The web page gives examples of the use of each of those functions.
You have to download the entire module and import it into your workbook.
This can NOT be done without VBA. -
WSprasad
AskWoody LoungerAugust 19, 2009 at 6:27 am #1174011The web page I referred you to contains a set of VBA functions that can be used in worksheet formulas to work with colors. The web page gives examples of the use of each of those functions.
You have to download the entire module and import it into your workbook.
This can NOT be done without VBA.Some more questions:
1. It is summing up the value based on cell color. But how to set another condition?
2. Is it possible to use the code as Add-in? I dont have a personal macro book and copying code everytime is little tedious. -
WSHansV
AskWoody LoungerAugust 19, 2009 at 6:51 am #1174015 -
WSprasad
AskWoody LoungerAugust 19, 2009 at 7:09 am #11740191. In cell C2:
=SUMPRODUCT((ColorIndexOfRange($A$2:$A$7,FALSE,0)=colorindexofonecell(C$1,FALSE,0))*($A$2:$A$7=C$1)*$B$2:$B$7)
2. You can import the module into an empty workbook and save it as an add-in (.xla), or you can import the module into an existing add-in.
speachless. I have tried everything including SUMPRODUCT, but in a different way. Thanks is somehow meaningless & I dont have an appropriate phrase to express gratitute. Regarding No. 2, I have saved the code as .xla but it is not working.
-
WSHansV
AskWoody Lounger -
WSprasad
AskWoody Lounger
-
-
-
-
-
WSprasad
AskWoody Lounger -
WSHansV
AskWoody Lounger -
WSprasad
AskWoody Lounger -
WSHansV
AskWoody LoungerAugust 21, 2009 at 7:29 am #1174395If you want a macro to be available in all workbooks it is more efficient to use an add-in (.xla) then to store the macro in every workbook.
If you do want a macro to be stored in the workbooks themselves, you can save a workbook that contains the macro (and whatever else you want) as an Excel template (.xlt). When you create a new workbook from the template, the macro will be part of the new workbook.
-
WSprasad
AskWoody LoungerAugust 21, 2009 at 7:42 am #1174404If you want a macro to be available in all workbooks it is more efficient to use an add-in (.xla) then to store the macro in every workbook.
If you do want a macro to be stored in the workbooks themselves, you can save a workbook that contains the macro (and whatever else you want) as an Excel template (.xlt). When you create a new workbook from the template, the macro will be part of the new workbook.
I understand & prefer the concern of using an add-in instead of store the macro in every workbook. The problem is that most reports created are meant for external customer and they may/may not have all the add-ins I am using. It is just a thought to save macro in wb as there is no other way (so far my knowledge permits) to make files worth-while, having add-in support.
Thanks again for your guidance.
-
WSHansV
AskWoody Lounger -
WSprasad
AskWoody LoungerAugust 21, 2009 at 8:04 am #1174419In that case, I’d create a template (.xlt) for your reports that contains the macros you need. When you need to create a new report, create it from the template instead of a blank workbook.
Thank you Hans for your extensive support. I am trying to create .xlt having desired macro & will revert on failure/success.
-
WSprasad
AskWoody Lounger -
WSHansV
AskWoody LoungerAugust 22, 2009 at 4:34 am #1174569If you save your template under the name Book.xlt in your Excel start folder (under Windows XP it’s usually C:Documents and SettingsApplication DataMicrosoftExcelXLSTART), it will be used when you create a blank new workbook. Do this only if you’re certain about it: the macros will be included in EVERY new blank workbook, increasing the file size.
The name Book.xlt is obligatory (and it depends on the language, in localized versions of Excel the name will be different).
The Application Data folder is hidden, so you must show hidden files and folders to be able to see it.
-
-
-
-
-
WSprasad
AskWoody Lounger -
WSHansV
AskWoody LoungerAugust 22, 2009 at 5:03 am #1174572You could save the template on your desktop and double-click it when you need it.
Or you could save it in your user templates folder (C:Documents and SettingsApplication DataMicrosoftTemplates). It will then be available in the dialog that appears when you click General Templates in the New Workbook task pane, and once you’ve used it, it will be listed directly in the task pane.
-
Viewing 2 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Lost sound after the upgrade to 24H2?
by
Susan Bradley
7 hours, 45 minutes ago -
How to move 10GB of data in C:\ProgramData\Package Cache ?
by
Alex5723
8 hours, 40 minutes ago -
Plugged in 24-7
by
CWBillow
16 hours, 1 minute ago -
Netflix, Apple, BofA websites hijacked with fake help-desk numbers
by
Nibbled To Death By Ducks
20 hours, 53 minutes ago -
Have Copilot there but not taking over the screen in Word
by
CWBillow
18 hours, 2 minutes ago -
Windows 11 blocks Chrome 137.0.7151.68, 137.0.7151.69
by
Alex5723
2 days, 12 hours ago -
Are Macs immune?
by
Susan Bradley
10 hours, 5 minutes ago -
HP Envy and the Function keys
by
CWBillow
1 day, 19 hours ago -
Microsoft : Removal of unwanted drivers from Windows Update
by
Alex5723
2 hours, 6 minutes ago -
MacOS 26 beta 1 dropped support for Firewire 400/800
by
Alex5723
2 days, 23 hours ago -
Unable to update to version 22h2
by
04om
7 hours, 48 minutes ago -
Windows 11 Insider Preview Build 26100.4482 (24H2) released to Release Preview
by
joep517
3 days, 7 hours ago -
Windows 11 Insider Preview build 27881 released to Canary
by
joep517
3 days, 7 hours ago -
Very Quarrelsome Taskbar!
by
CWBillow
2 days, 16 hours ago -
Move OneNote Notebook OFF OneDrive and make it local
by
CWBillow
3 days, 20 hours ago -
Microsoft 365 to block file access via legacy auth protocols by default
by
Alex5723
3 days, 8 hours ago -
Is your battery draining?
by
Susan Bradley
8 hours, 25 minutes ago -
The 16-billion-record data breach that no one’s ever heard of
by
Alex5723
8 hours, 26 minutes ago -
Weasel Words Rule Too Many Data Breach Notifications
by
Nibbled To Death By Ducks
3 days, 23 hours ago -
Windows Command Prompt and Powershell will not open as Administrator
by
Gordski
2 hours, 11 minutes ago -
Intel Management Engine (Intel ME) Security Issue
by
PL1
3 days, 8 hours ago -
Old Geek Forced to Update. Buy a Win 11 PC? Yikes! How do I cope?
by
RonE22
3 days ago -
National scam day
by
Susan Bradley
2 days, 7 hours ago -
macOS Tahoe 26 the end of the road for Intel Macs, OCLP, Hackintosh
by
Alex5723
3 days, 3 hours ago -
Cyberattack on some Washington Post journalists’ email accounts
by
Bob99
5 days ago -
Tools to support internet discussions
by
Kathy Stevens
3 days, 13 hours ago -
How get Group Policy to allow specific Driver to download?
by
Tex265
4 days, 16 hours ago -
AI is good sometimes
by
Susan Bradley
5 days, 8 hours ago -
Mozilla quietly tests Perplexity AI as a New Firefox Search Option
by
Alex5723
4 days, 22 hours ago -
Perplexity Pro free for 12 mos for Samsung Galaxy phones
by
Patricia Grace
6 days, 8 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.