#1   Report Post  
Posted to microsoft.public.excel.misc
Frank Drost
 
Posts: n/a
Default if statement

I would like to set up an if statement that does the following:

If in row $2, the maximum is within $B2:$G2, than if the sum of $B2:$G2 is
less than the sum of $H2:$M2, then print the sum of $B2:$G2 in the box,
colour red. If not, than print the sum of $H2:$M2 in the box, colour blue.

How do I do that? Can that be done in 1 statement?

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.misc
Rowan Drummond
 
Posts: n/a
Default if statement

You can't change the format of a cell using a formula so one way is to
use a combination of formatting, a formula and conditional fomatting.
Select cell N2.
Change the format to blue.
Enter the formula: =MIN(SUM(B2:G2),SUM(H2:M2))
Click on FormatConditional Formatting.
Then change the first drop down box to Formula Is.
In the second dropdown enter the formula: =N2=Sum(B2:G2)
Click on the format button and then select the required red format.
Ok out.

Hope this helps
Rowan

Frank Drost wrote:
I would like to set up an if statement that does the following:

If in row $2, the maximum is within $B2:$G2, than if the sum of $B2:$G2 is
less than the sum of $H2:$M2, then print the sum of $B2:$G2 in the box,
colour red. If not, than print the sum of $H2:$M2 in the box, colour blue.

How do I do that? Can that be done in 1 statement?

Thanks

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
If statement Matt Montagliano Excel Discussion (Misc queries) 1 September 8th 05 08:47 PM
Do I need a sumif or sum of a vlookup formula? PeterB Excel Worksheet Functions 0 June 1st 05 12:23 PM
IF Statement nightmare eugenevr Excel Discussion (Misc queries) 6 May 18th 05 01:09 PM
What statement to use? Paul Excel Worksheet Functions 6 February 13th 05 05:23 PM
7+ nested if statement? Turi Excel Worksheet Functions 3 December 20th 04 07:55 PM


All times are GMT +1. The time now is 11:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"