Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: If statements in Excel worksheets.


05 Aug 2011   #1
BomberAF

Windows 7
 
 
If statements in Excel worksheets.

How do you add if statements to formula in Excel that change the formating of the cells.

For instace:

If I have a sum which subtracts one cell from another and I want the colour of the text in the results cell to turn red if the value becomes negative.

And:

If I have a number in a cell and while the number is say 8 then that is fine so I want nothing to change, but if the number becomes say 3 then I want the colour of text in the cell to turn red, how would I go about it.

Regards

AF


My System SpecsSystem Spec
05 Aug 2011   #2
mjm6783

XP Professional, 7 Professional
 
 

Man, I haven't had to try this in a long while. I remember it used to be a rule menu called "conditional formatting", but I've never tried it in newer versions of excel. Give me a minute and I try to reacquaint myself.

EDIT: Home tab, Conditional formatting is it's own button
My System SpecsSystem Spec
05 Aug 2011   #3
jimbo45

W7 X-64 W8.1 X-64 Opensuse 13.1 W2003 Server
 
 

Hi there
probably the easiest way is to start to RECORD a Macro (open the development developers ? tag and chose start recording.

Do your IF or whatever you want in the cell(s) then STOP RECORDING and then look at the VBA code.

Other than that look at the excel help == I know there are a load of string / conditional formatting statements.

If you know the range of cells relative to the start column it's probably best to have this in a macro whenever data is entered into the appropriate cells.

Cheers
jimbo
My System SpecsSystem Spec
05 Aug 2011   #4
BomberAF

Windows 7
 
 

Quote   Quote: Originally Posted by mjm6783 View Post
Man, I haven't had to try this in a long while. I remember it used to be a rule menu called "conditional formatting", but I've never tried it in newer versions of excel. Give me a minute and I try to reacquaint myself.

EDIT: Home tab, Conditional formatting is it's own button

Thanks for that, I was expecting a pain in the arse formula would have to be inserted but Excel does all the hard work for you.

Cheers
My System SpecsSystem Spec
05 Aug 2011   #5
BomberAF

Windows 7
 
 

Quote   Quote: Originally Posted by jimbo45 View Post
Hi there
probably the easiest way is to start to RECORD a Macro (open the development developers ? tag and chose start recording.

Do your IF or whatever you want in the cell(s) then STOP RECORDING and then look at the VBA code.

Other than that look at the excel help == I know there are a load of string / conditional formatting statements.

If you know the range of cells relative to the start column it's probably best to have this in a macro whenever data is entered into the appropriate cells.

Cheers
jimbo
Thanks for the help but I think the conditional formating will be much easier than having to arse around with macro's.
My System SpecsSystem Spec
Reply

 If statements in Excel worksheets.




Thread Tools



Similar help and support threads for2: If statements in Excel worksheets.
Thread Forum
The CopyProfile and DisableFirstRunWizard statements not work Installation & Setup
Solved How do I turn off worksheets in w7 calculator? General Discussion
Need software to find duplicates in excel worksheets Software
How to download bank statements Microsoft Office
Win 7 calculator worksheets General Discussion
PDF Statements from Secure Sites Software

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 09:30 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App