Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

Excel - If two cells are greater than 0, than return the cell that is greater, if only one cell is greater than 0, than return that value

Writer Andrew Mclaughlin

I have been trying to figure this out for a while now but I'm stuck on the [value_if_false] part and I feel like it's really simple but it's not coming to me.

So basically, trying to display the greater of two numbers (in specific cells) if both of them are numbers, but if only one of them is a number, then display that number.

=IF(AND(L10>0,L20>0),IF(L10>L20,L10,L20),)

I cannot figure out for the life of me what comes after the comma, help would be much appreciated, sorry if this has been asked before, couldn't find it myself.

2 Answers

Just handle the exception case first:

=IF(AND(L10<=0,L20<=0),"",MAX(L10,L20))

Why not simply use:

=MAX(L10,L20)

Edit:

An alternative, if you want blank returned when no numbers exist:

=IF(NOT(COUNT(A1:B1)),"",MAX(A1:B1))
2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy