+ Reply to Thread
Results 1 to 2 of 2

if statement

  1. #1
    Frank Drost
    Guest

    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. #2
    Rowan Drummond
    Guest

    Re: 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 Format>Conditional 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1