+ Reply to Thread
Results 1 to 8 of 8

Create an outcome based on two Cell Entries

  1. #1
    Registered User
    Join Date
    10-30-2007
    Location
    Oklahoma
    Posts
    17

    Create an outcome based on two Cell Entries

    Hi everyone,
    I'm new to this forum so please excuse any mishaps that I may cause.

    I've been given a task of creating a very complex spreadsheet and don't have a clue as where to start.

    What I need to do is accept text or numbers from two different cells and automatically color fill the entire row light-green. If the first cell receives the text "SC", and the second receives "BP" then it should fill the row green. If any other entries are made, nothing should happen.

    I don't know if cell fomating is required or if VBA programming is needed. Either way, being dumber than a dirt clod, I request a bit of advice on how to do this.

    Thanks in advance for your help.

  2. #2
    Forum Contributor
    Join Date
    10-30-2007
    Location
    Norway
    MS-Off Ver
    MS Office 2007
    Posts
    345

    Use Conditional formatting

    Select the entire row (Row 1 in this example)
    Select in menu Format -> Conditional Formatting
    Select "Formula is" from drop down menu and put in this formula.

    =IF(AND($A1="SC",$B1="BP"),TRUE,FALSE)

    Then press "Format" button and select the color you want from the "Pattern" tab

    The formatting can be copied to other rows with "Copy" and "Paste Special" selcting "Formatting" in the Paste Special window. Or you can just select all the rows instead of one row when you apply the conditional formatting.

  3. #3
    Registered User
    Join Date
    10-30-2007
    Location
    Oklahoma
    Posts
    17
    =IF(AND($A1="SC",$B1="BP"),TRUE,FALSE)

    Does this read as;
    =IF starts an If statement
    AND both arguments apply
    $ text from cell A1
    ="SC" my input
    $ text from cell B1
    ="BP" my input
    TRUE if it's true then do "this"
    FALSE if it's false do "this"

    Thanks for the answer. I haven't tried it yet, but will today.

  4. #4
    Forum Contributor
    Join Date
    10-30-2007
    Location
    Norway
    MS-Off Ver
    MS Office 2007
    Posts
    345
    Yes you are correct, but when you put this formula in the formula field of of the conditional format window you are not supposed to replace the TRUE and FALSE statements with anything. Just enter the formula as it is.
    If the outcome of the formula is TRUE the conditional formatting i applied.

    The $ in the cell refference is for making the column part of the refference absolute, so when you copy the conditional formatting to other cells only the row refference is changed relative to the row you first entered the formula in.

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Bjornar,

    FYI...since the only results you can get from Conditional Formatting is True or False, you don't actually need the IF() with those results...

    just simply: AND($A1="SC",$B1="BP") would work because this yields TRUE or FALSE
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  6. #6
    Registered User
    Join Date
    10-30-2007
    Location
    Oklahoma
    Posts
    17
    I tried your suggestion earlier. Works fine.


    Next question:

    If a inventory number (100089) is entered into cell Cx, how can I get the dimensions into cell Fx? I believe I would have to list all sizes off to the side then do an IF statement to reference the correct one. A conditional statement wouldn't be needed because there are not two arguements.

    Would this be correct?

    =IF $C1=100089,(F1= L1) L1 being the cell that the dimensions for 100089 are listed.

    Side note, is there a way I can post part of my spreadsheet so you can see what I'm trying do do?

    I really appreciate your help 'cause I have no idea............

  7. #7
    Forum Contributor
    Join Date
    10-30-2007
    Location
    Norway
    MS-Off Ver
    MS Office 2007
    Posts
    345
    You can attach a .xls file to your post, but you have to pack it into a .zip file first.

  8. #8
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    Hi,

    It sounds like you need to use VLOOKUP in Cell Fx, so that when you enter the number in Cx, the formula in Fx Looks in a table for the number and then finds the dimensions to put in the cell.

    Checkout excel help on VLOOKUP.

    As Bjornar says, if you can attached a ZIPPED example you will get better help.

    Ed

+ 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