SOLVED

Need help on an IF Function

Copper Contributor

Hello,

 

I have 2 questions on the same function.

1. I am wondering If or how to reference cell fill color in an If statement logical test. 

2. I am wondering how to have two separate logical tests within the same function.

 

I am trying to have cell4 calculate cell1-cell2 unless it is 1.filled in yellow or 2. the difference is less than cell3. Here is an example of what I am trying to do:

 

cell4=IF(cell1="cellfillyellow" or cell1-cell2<cell3,"cell1",cell1-cell2

 

Can anyone help me?

2 Replies
best response confirmed by Daniel Desmarais (Copper Contributor)
Solution

Hi Daniel,

 

That doesn't work such way. Excel formulas are working with cell values only. Color is the property of the cell, you may handle it only using VBA macros.

 

On the other hand most probably you have some logic behind why this or that cell has this or that color. If you put this logic into the formulas you may combine both. If, for example, the logic is the A1 is yellow if the value in A1 is less than 10, when

A4=IF(OR(A1<10,(A1-A2)<A3),A1,A1-A2)

 

Thank you Sergei. I went to the root of the formatting and got it to work that way. Regards,
1 best response

Accepted Solutions
best response confirmed by Daniel Desmarais (Copper Contributor)
Solution

Hi Daniel,

 

That doesn't work such way. Excel formulas are working with cell values only. Color is the property of the cell, you may handle it only using VBA macros.

 

On the other hand most probably you have some logic behind why this or that cell has this or that color. If you put this logic into the formulas you may combine both. If, for example, the logic is the A1 is yellow if the value in A1 is less than 10, when

A4=IF(OR(A1<10,(A1-A2)<A3),A1,A1-A2)

 

View solution in original post