which function can get the desired result?

A

ADK

Is there a function for this:

example:

cell B1 = 115
cell B2 = 120
cell B3 = 200

B1 thru B3 are variables that will change based on user input.
I want cell B4 to equal "CC" if B1 is closer to B2, but if B1 is closer to
B3 than B2, B4 will equal "C"

Any function(s) that can get this result?

Thanks
 
D

David Biddulph

=IF(ABS(B1-B2)<ABS(B1-B3),"CC","C")

You haven't said what you want as an output if B1 is equidistant from B2 and
B3.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top