# Compare and output greater value.February 5, 2009 4:57 AM   Subscribe

Spreadsheet question: Display Greater Value? I know this is one of those "you-either-know-it-or-you-don't" situations, and I just don't know.

Hokay, so here's ze situation:

There are two columns of numbers, A and B

A1 has a value of 10, and B1 has a value of 15.

What do I type into C1 to compare A1 and B1, and display the greater value of 15?
posted by guptaxpn to Technology (6 answers total) 1 user marked this as a favorite

MAXA(A1:B1)
posted by Happy Dave at 4:59 AM on February 5, 2009

That'll work for any range. So, say you have five columns, and you want the sixth column to show the greatest number in those five columns, you'd just make the range A1:E1.
posted by Happy Dave at 5:00 AM on February 5, 2009

Also, if you're having trouble with figuring out what function to use, in Excel 2003 and later you can click the 'Function' button (to theleft of the display bar), and type in a plain english description of what you're trying to do. So for this, you'd type in 'find the greatest number' and it'd give you back MAXA and other comparison functions.
posted by Happy Dave at 5:02 AM on February 5, 2009

MAXA, as stated above, is the clean way to do this.

You can do all sorts of comparisons with If as well, it's not as clean for this but it lets you do other kinds of things besides simple greater or lesser functions:

IF(A1>B1, A1, B1)

Throw in some booleans, some text functions and maybe some conditional formatting and you can go insane!

IF(A1>B1,"Win!",IF(A1=B1,"Meh.","FAIL!"))
posted by Kid Charlemagne at 6:12 AM on February 5, 2009 [1 favorite]

Kid Charlemagne: "MAXA, as stated above, is the clean way to do this.

You can do all sorts of comparisons with If as well, it's not as clean for this but it lets you do other kinds of things besides simple greater or lesser functions:

IF(A1>B1, A1, B1)

Throw in some booleans, some text functions and maybe some conditional formatting and you can go insane!

IF(A1>B1,"Win!",IF(A1=B1,"Meh.","FAIL!"))
"

Of course, you need semicolons everywhere you have commas.
posted by TypographicalError at 6:59 AM on February 5, 2009

Of course, you need semicolons everywhere you have commas.

Is guptaxpn asking about Excel here? In Excel, the commas work just fine and semicolons don't work. Of course, he'd need an "=" sign in front.
posted by losvedir at 7:31 AM on February 5, 2009

« Older Where was Shepherd Fairy interviewed?   |   Modem router combi device supported by dd-wrt Newer »