ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   set "value if true" to "fill cell with color" (https://www.excelbanter.com/excel-programming/335296-set-value-if-true-fill-cell-color.html)

Feeta

set "value if true" to "fill cell with color"
 
I want to use an IF statement to check for text in a cell range and if true,
then fill a cell with a highlight color. In my application, I would look for
"PD" in invoice date fields and if found, highlight the amount invoiced in
green. I don't know the snytax to write the return value as "fill this cell
with color".

Trevor Shuttleworth

set "value if true" to "fill cell with color"
 
You can't do what you want in the way that you describe, that is, with a
formula. Have a look at conditional formatting. That will do what you
want.

Assume that your invoice dates are in column C, starting in row 2. In Cell
D2, or whatever:

Format | Conditional Formatting... | Condition 1: Formula is | =C2="pd"

Change the format as required, for example, Format | Patterns = green

Copy the formatting to the other cells you want to highlight.

Regards

Trevor


"Feeta" wrote in message
...
I want to use an IF statement to check for text in a cell range and if
true,
then fill a cell with a highlight color. In my application, I would look
for
"PD" in invoice date fields and if found, highlight the amount invoiced in
green. I don't know the snytax to write the return value as "fill this
cell
with color".




STEVE BELL

set "value if true" to "fill cell with color"
 
Check out Conditional Formatting...

No code required. Just use a formula condition.

--
steveB

Remove "AYN" from email to respond
"Feeta" wrote in message
...
I want to use an IF statement to check for text in a cell range and if
true,
then fill a cell with a highlight color. In my application, I would look
for
"PD" in invoice date fields and if found, highlight the amount invoiced in
green. I don't know the snytax to write the return value as "fill this
cell
with color".




Feeta

set "value if true" to "fill cell with color"
 
Thank you, this is exactly what I needed to know. I appreciate the detail you
provided.

"Trevor Shuttleworth" wrote:

You can't do what you want in the way that you describe, that is, with a
formula. Have a look at conditional formatting. That will do what you
want.

Assume that your invoice dates are in column C, starting in row 2. In Cell
D2, or whatever:

Format | Conditional Formatting... | Condition 1: Formula is | =C2="pd"

Change the format as required, for example, Format | Patterns = green

Copy the formatting to the other cells you want to highlight.

Regards

Trevor


"Feeta" wrote in message
...
I want to use an IF statement to check for text in a cell range and if
true,
then fill a cell with a highlight color. In my application, I would look
for
"PD" in invoice date fields and if found, highlight the amount invoiced in
green. I don't know the snytax to write the return value as "fill this
cell
with color".





Trevor Shuttleworth

set "value if true" to "fill cell with color"
 
You're welcome, thanks for the feedback.


"Feeta" wrote in message
...
Thank you, this is exactly what I needed to know. I appreciate the detail
you
provided.

"Trevor Shuttleworth" wrote:

You can't do what you want in the way that you describe, that is, with a
formula. Have a look at conditional formatting. That will do what you
want.

Assume that your invoice dates are in column C, starting in row 2. In
Cell
D2, or whatever:

Format | Conditional Formatting... | Condition 1: Formula is | =C2="pd"

Change the format as required, for example, Format | Patterns = green

Copy the formatting to the other cells you want to highlight.

Regards

Trevor


"Feeta" wrote in message
...
I want to use an IF statement to check for text in a cell range and if
true,
then fill a cell with a highlight color. In my application, I would
look
for
"PD" in invoice date fields and if found, highlight the amount invoiced
in
green. I don't know the snytax to write the return value as "fill this
cell
with color".








All times are GMT +1. The time now is 06:12 PM.

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