Windows 7 Forums


Windows 7: If statements in Excel worksheets.

05 Aug 2011   #1

Windows 7
Liverpool
 
 
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

XP Professional, 7 Professional
Portland, OR
 
 

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

W7 X-64 RTM,SUSE 11.1, XP PRO SP3 as a VM, VMware ESXi
Hafnarfjörður IS
 
 

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

Windows 7
Liverpool
 
 

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

Windows 7
Liverpool
 
 

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. problems?



Thread Tools



Similar help and support threads for: If statements in Excel worksheets.
Thread Forum
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


All times are GMT -5. The time now is 11:34 PM.



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