View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Teethless mama Teethless mama is offline
external usenet poster
 
Posts: 3,718
Default which function can get the desired result?

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


"ADK" wrote:

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