• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Comparing two values.

bobo88

New Member
I have Two values, say 250 in cell A1 and 350 in cell B1.

Now I want to check if the value in A1 is smaller than that in B1.

I wish to have a cell which shows when this statment is correct or is being violated. ( Say 100 in A1 and 25 in B1). Is there a method how to achieve this?


Thanks


Adrian
 
Bobo88


Welcome to the Chandoo.org Forums


A simple formula =A1<B1

Will return True when A1 is less than B1or False otherwise


If you want words

=IF(A1<B1,"A1 is smallest", "B1 is smallest")

Will do
 
Thanks for the help, its what I wanted.


By any chance is there a method to highlight the cell in Green when it true, and in Red when its False automatically?


Thanks Again.
 
Good day bobo88

Have a look at this https://dl.dropbox.com/u/75495784/Conditional_Formating.xlsx
 
bobhc I see that when values in column A are greater than that in column B the column B cells become green. and become red for vice versa. can you explain how its done??
 
Good day bobo88

Select all cells in column B (cells to be formatted) go to CONDITIONAL FORMATTING in the styles section of the Home tab on the ribbon (I believe in 2003 it is in the formatting section) on the drop down click on NEW RULE, in the top window called SELECT A RULE TYPE select the bottom one. USE A FORMULA TO DETERMINE WHICH CELLS TO FORMAT in the bottom section in the box where it says FORMAT VALUES WHERE THIS FORMULA IS TRUE ENTER THIS FORMULA =$B1<$A1 this locks the formula to the columns but not to the rows as you are formatting more than one row. Then click on the FORMAT BUTTON and then on the FILL TAB I picked green for this fill.

I then did all above steps again but entered the formula =$B1>$A1 and filled red.

In the drop down from CONDITIONAL FORMATTING you can pick MANAGE RULES at the top left it says SHOW FORMATTING RULES FOR: click on the small downed pointing black triangle and pick THIS WORKSHEET the formatting rules for the worksheet will be shown, highlight one and the pick the EDIT button, you can then see the formulas or change if needed such as the colour

This takes longer to read than actually do
 
Back
Top