Solved If statements in Excel worksheets.

BomberAF

New member
Member
VIP
Local time
9:00 PM
Messages
491
Location
Liverpool
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 Computer My Computer

Computer Manufacturer/Model Number
Dell Inspiron
OS
Windows 7
CPU
2.4 GHz Intel i3 cpu
Memory
8GB
Mouse
MS Explorer Mouse
Internet Speed
100 Mb/s
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 Computer My Computer

OS
XP Professional, 7 Professional
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 Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom built, several laptops HP/ASUS
OS
Linux CENTOS 7 / various Windows OS'es and servers
CPU
Intel i7 Intel i5
Memory
8GB, 16GB
Graphics Card(s)
On Motherboard
Sound Card
Realtek HD audio
Monitor(s) Displays
Apple Cinema display, Samsung LCD
Screen Resolution
1920 X 1080
Hard Drives
4 X 1TB SATA
Mouse
Toshiba wireless laser
Internet Speed
> 20MB up
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 Computer My Computer

Computer Manufacturer/Model Number
Dell Inspiron
OS
Windows 7
CPU
2.4 GHz Intel i3 cpu
Memory
8GB
Mouse
MS Explorer Mouse
Internet Speed
100 Mb/s
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 Computer My Computer

Computer Manufacturer/Model Number
Dell Inspiron
OS
Windows 7
CPU
2.4 GHz Intel i3 cpu
Memory
8GB
Mouse
MS Explorer Mouse
Internet Speed
100 Mb/s
Back
Top