# Microsoft Office Application Help - Excel Help forum > Excel General >  >  =IF (cell color) then?

## stevemyers

Two part question:

1. How do I structure an IF statement based on a specific cell color (e.g. if a cell is yellow, then perform function x)

2. How do I know what color is what? Is there a pantone reference? A color "name" that excel uses?

Thanks

----------


## martindwilson

why is the cell coloured?
you can use conditional format to colour the cell then use the same criteria in a function

----------


## stevemyers

The cells are not conditionally formatted...it is a manual process based on non-conditional input.

----------


## Palmetto

Excel does not have a built in function to determine cell color. You would need to use VBA code to determine cell color.

If you can use a VBA solution, search the Forum using terms like: Count cells by color, or Sum cells by color, etc.

To martin's point, what logic are you using to determine cell color? If the fill color selection is a random process (no logic or consistency), then it will be a bit difficult to determine which cells to reference in any formula.

Sum/Count Cells By Fill Or Background Color in Excel

----------


## oldchippy

Hi,

This might help?

http://excel.tips.net/Pages/T001978_..._of_Cells.html

----------


## krichmond0306

I could use help with this also, to be specific, I am taking data and assigning it a confidence level.  The confidence level is going to be indicated by the use of cell background color, ie a green cell indicates a +/- 10% confidence level and therefore my expected data rande is X+(X*.1) and X-(X*.1) and so on (X being my measured sampled.

How do I create function so that IF the cell is one it uses one confidence level, if its another then a different one, etc?

----------


## on_way_to_fame

I know I am digging an old post here, but I wonder if the new excel 2013, has a solution to this. I am manually colouring a cell and want it show an x value (referenced from a different cell), if the colour is say green and a 0 if its red.

----------


## arlu1201

on_way_to_fame,

Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do.  Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.

----------


## on_way_to_fame

Hi,

Apologies for that. I will create a new thread for this.

----------


## Jack7774

Writing a macro that creates a function (customized excel formula) is the trick you are looking for. What is the "perform x" that you want it to do exactly?

----------


## baffled_in_tx

On_way_to_fame,
Did you ever find a solution to your problem?  I am trying to do the same thing.    :Confused:

----------


## FDibbins

baffled, perhaps you missed reading post #8?

 :Smilie:

----------

