+ Reply to Thread
Results 1 to 4 of 4

"IF" Formula Query

  1. #1
    Langoose
    Guest

    "IF" Formula Query

    I'm want to use an "IF" formula to compare the values in two cells and return
    the following...

    IF cell A is equal to cell B I want the formula cell to be yellow with a "Y"
    in it
    IF cell A is greater than cell B I want the formula cell to be green with a
    "G" in it
    IF cell A is smaller than cell B by more than 1000 I want the formula cell
    to be red with an "R" in it
    IF cell A is smaller than cell B by less than 1000 I want the formula cell
    to be yellow with a "Y" in it

    Hope that makes sense, any help would be greatly appreciated...

  2. #2
    Forum Expert
    Join Date
    09-09-2005
    Location
    England
    MS-Off Ver
    2007
    Posts
    1,500
    You have to do 2 things
    1) use a formula with an if statement
    =IF(A1=B1,"Y",IF(A1>B1,"G",IF(A1<B1-1000,"R","Y")))

    2) Format the cells

    Format the cell colour as Yellow


    Fomat_conditional formating
    Cellvalue is equal to =”G” format green
    Cellvalue is equal to =”R” format red
    Celllvalue is equal to =”Y” format Yellow

    But you are using yellow twice in your logic is this correct if so
    =IF(A1>B1,"G",IF(A1>B1-1000,"Y","R"))

    and use only the first 2 contional formating conditions

    Regards

    Dav

  3. #3
    Ardus Petus
    Guest

    Re: "IF" Formula Query

    =IF(B-A<1000,"Y",IF(B-A>=1000,"R","G")

    Format>Conditional Format
    Condition 1: Cell value is equal to Y, click Format select Yellow
    Click Add
    Condition 2: Cell value is equal to G, click Format select Green
    Click Add
    Condition3 Cell value is equal to R, click Format select Red

    Et voilà!

    --
    AP


    "Langoose" <[email protected]> a écrit dans le message de
    news: [email protected]...
    > I'm want to use an "IF" formula to compare the values in two cells and
    > return
    > the following...
    >
    > IF cell A is equal to cell B I want the formula cell to be yellow with a
    > "Y"
    > in it
    > IF cell A is greater than cell B I want the formula cell to be green with
    > a
    > "G" in it
    > IF cell A is smaller than cell B by more than 1000 I want the formula cell
    > to be red with an "R" in it
    > IF cell A is smaller than cell B by less than 1000 I want the formula cell
    > to be yellow with a "Y" in it
    >
    > Hope that makes sense, any help would be greatly appreciated...




  4. #4
    David Biddulph
    Guest

    Re: "IF" Formula Query

    "Langoose" <[email protected]> wrote in message
    news:[email protected]...
    > I'm want to use an "IF" formula to compare the values in two cells and
    > return
    > the following...
    >
    > IF cell A is equal to cell B I want the formula cell to be yellow with a
    > "Y"
    > in it
    > IF cell A is greater than cell B I want the formula cell to be green with
    > a
    > "G" in it
    > IF cell A is smaller than cell B by more than 1000 I want the formula cell
    > to be red with an "R" in it
    > IF cell A is smaller than cell B by less than 1000 I want the formula cell
    > to be yellow with a "Y" in it


    =IF(A1>B1,"G",IF(A1<B1-1000,"R","Y"))
    And then use conditional format, if cell value ="R" make the background red,
    etc.
    --
    David Biddulph



+ 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