Avatar of Jenkins
Jenkins
Flag for United States of America asked on

Control Excel cell color using a function

Hello.

Wondering if cell color can be controlled using a function instead of a macro.  Specifically what I need is to turn the cell fill color yellow when a data entry error is made by a user.  Here is my existing function which is in Cell C3:

=IF(SUM(B3-A3)>0,"Error","")

In addition to displaying "Error", which it already does, I want to modify the function to turn cell C3 yellow when an Error is made (i.e. when the value in B3 is greater than the value of A3)

Thank you
Microsoft ExcelMicrosoft Office

Avatar of undefined
Last Comment
Martin Liss

8/22/2022 - Mon
Martin Liss

Add Conditional Formatting in C3 that looks like this.

Cursor_and_Conditional_Formatting_Ru.jpg
ASKER CERTIFIED SOLUTION
Martin Liss

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Jenkins

ASKER
Thanks
Martin Liss

You're welcome and I'm glad I was able to help.

If you expand the “Full Biography” section of my profile you'll find links to some articles I've written that may interest you.

Marty - Microsoft MVP 2009 to 2017
              Experts Exchange MVE 2015
              Experts Exchange Top Expert Visual Basic Classic 2012 to 2017
Your help has saved me hundreds of hours of internet surfing.
fblack61