View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
John Pritchard John Pritchard is offline
external usenet poster
 
Posts: 6
Default Comparing cell values

Hi there,
Try entering this formula in column D:-

= IF(AND(ISNUMBER(B1),ISNUMBER(C1)),IF(OR(C1-B1 1,C1-B1
< -1),"Out of Range","In Range"),"Not both Numbers")

My guess is you wanted numbers that are within +/- 1 of
each other.

-----Original Message-----
How do I use VBA to compare data in two cells to return
something. Eg. Column B has numbers,but no zero values,
and Column C has numbers but can contain blank cells.
How do I write code to say if it has numbers in Column C
then to do a calculation that says if column C - Column

B
< + 1 or - 1, then in column D type "Within Range"
else "out of range".
.