Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

recognizing character formating in excel formula

Status
Not open for further replies.

dh42891

Technical User
Oct 7, 2003
107
US
I'm creating a progress tracking spreadsheet. I'm new to this and only need a simple formula that calculates a percent, but I'm trying to figure more complicated stuff out.

I'm using COUNTA to count the instances in one column and divide it by the instances in another. Now, I'm hoping there is a way to only count the intances of text in a column that matches certain formatting criteria (i.e. bold text, or red colored text). Is that possible?


dylan
 


Hi,

Is there logic to the cell formatting? If so, use the same logic.

Skip,

[glasses] [red]Be Advised![/red] A chicken, who would drag a wagon across the road for 2 cents, is…
POULTRY in motion to PULLET for a PALTRY amount! [tongue]
 
I'm not sure what you mean. The cells that are being counted using COUNTA are entered manually, and then I manually change the formatting. Those cells are formatted based on what kind of job they are related to. But the formatting is not done automatically by Excel, if that's what you're asking. Thanks,

dylan
 
Dylan,

Yes, Skip was asking if the cells were changing color based on Conditional Formatting. If they were, you could apply whatever logic you used in the CF to a worksheet formula.

But since you're not....

There is no way to determine font formatting with Excel Functions (formulas). The Cell function can tell you the Number Format of a cell, but not if it is Bold.

You will need VBA to determine that.

[attn]BUT[/attn]:

If there is any logic to which cells are formatted differently, you can use that to your advantage.

If, for example,
cells in column A are Bold
[tab]where the corresponding cell in column B is "John"

and

cells in column A are [red]Red[/red]
[tab]where the corresponding cell in column B is "Dylan",

then you can use that underlying logic in a formula to get your counts.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
Okay, I thought that might be the case. I was hoping to write a formula that would count if the font was Courier 8 instead of 10, or something like that. It sounds like I'll have to restructure the spreadsheet to accomplish what I'm trying to do. Not a big deal though. Thanks a lot for the help,

dylan
 
No problem. And again, you can do what you are asking ("...if the font was Courier 8 instead of 10"), but it would require VBA.

If you want to pursue that course of action, start a new thread in forum707, the "VBA Visual Basic for Applications (Microsoft) Forum".

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ181-2886 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top