ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Formula for a fill color help (https://www.excelbanter.com/new-users-excel/124724-formula-fill-color-help.html)

Bryan J

Formula for a fill color help
 
I can't figure out how to make a formula that will recognize a color as a value. More specifically; If b1 is made to be green (color index 4) I would like c1 to insert the letter Y. I am I'm looking for an IF statement so I can use it throughout the whole workbook.

The formula if I understand it should kind of look like (in C1):

=If(b1=colorindex4,"Y","")

I'm looking to put a "Y" in c1 if b1 is colored in green.

I would really like to also know how to insert a fill color in any formula!

Thank you for any of your help and time,

Bryan

John Bundy

Formula for a fill color help
 
You can add color and perform tasks with them through code but not with a
standard function. You can however create a UDF.

--
--
-John
Please rate when your question is answered to help us and others know what
is helpful.

"Bryan J" wrote in message
...

I can't figure out how to make a formula that will recognize a color as
a value. More specifically; If b1 is made to be green (color index 4) I
would like c1 to insert the letter Y. I am I'm looking for an IF
statement so I can use it throughout the whole workbook.

The formula if I understand it should kind of look like (in C1):

=If(b1=colorindex4,"Y","")

I'm looking to put a "Y" in c1 if b1 is colored in green.

I would really like to also know how to insert a fill color in any
formula!

Thank you for any of your help and time,

Bryan




--
Bryan J




Max

Formula for a fill color help
 
Try this sample from my archives:
http://www.savefile.com/files/378485
Count n Sum Cells By FillColor_BobPhillips_ColorIndex_UDF.xls
(nicely rendered, full details)

The sample file contains an implementation of Bob Phillips' ColorIndex
Function from his "Processing Coloured Cells" page at:
http://www.xldynamic.com/source/xld.ColourCounter.html
and some examples on how to use the UDF in Excel

In the sample file, albeit its not illustrated therein,
you would be able to use IF's along these lines:
=IF(ColorIndex(D2)=4,"Y","")
(above would be as per your intents expressed in the post)

Note: As clarified in Bob's page under "Constraints" section, you would
need to press F9 to force calculate as, quote: " .. change a cell's
colour or the text colour does not trigger the Excel calculate event.
This is not a shortcoming of the UDF, but of Excel's calculation event
... "
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
Bryan J wrote:
I can't figure out how to make a formula that will recognize a color as
a value. More specifically; If b1 is made to be green (color index 4) I
would like c1 to insert the letter Y. I am I'm looking for an IF
statement so I can use it throughout the whole workbook.

The formula if I understand it should kind of look like (in C1):

=If(b1=colorindex4,"Y","")

I'm looking to put a "Y" in c1 if b1 is colored in green.

I would really like to also know how to insert a fill color in any
formula!

Thank you for any of your help and time,

Bryan




--
Bryan J



Gord Dibben

Formula for a fill color help
 
Bryan

Excel cannot do this without VBA code of some type.

See Chip Pearson's site for UDF's for working with colors.

http://www.cpearson.com/excel/colors.htm

With Chip's CellColorIndex UDF your formual would look like

=IF(Cellcolorindex(B1)=4,"Y","")


Gord Dibben MS Excel MVP

On Thu, 4 Jan 2007 18:52:59 +0000, Bryan J
wrote:


I can't figure out how to make a formula that will recognize a color as
a value. More specifically; If b1 is made to be green (color index 4) I
would like c1 to insert the letter Y. I am I'm looking for an IF
statement so I can use it throughout the whole workbook.

The formula if I understand it should kind of look like (in C1):

=If(b1=colorindex4,"Y","")

I'm looking to put a "Y" in c1 if b1 is colored in green.

I would really like to also know how to insert a fill color in any
formula!

Thank you for any of your help and time,

Bryan




All times are GMT +1. The time now is 09:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com