View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
Niek Otten
 
Posts: n/a
Default Complicated formula help required

You are right, thanks.
I think the OP's question has been answered already.

--
Kind regards,

Niek Otten

"David Biddulph" wrote in message ...
"Niek Otten" wrote in message ...

"recklaw" wrote in message
...

Hi everyone.

I'm looking to create a formula which to me is quite complicated.
In essence I need to carry out the following: -

If X = Y then result = 12
If X = Y plus or minus 2 then result = 11
If X = Y plus or minus 4 then result = 10
If X = Y plus or minus 6 then result = 9
If X = Y plus or minus 8 then result = 8
If X = Y plus or minus 10 then result = 7
If X = Y plus or minus 12 then result = 6
If X = Y plus or minus 14 then result = 5
If X = Y plus or minus 16 then result = 4
If X = Y plus or minus 18 then result = 3
If X = Y plus or minus 20 then result = 2
If X = Y plus or minus 22 then result = 1
else result = 0

I have a 'working out' spreadsheet if this helps
I figured I could have 12 different If cells, but can I use an if
formula with 4 Or formulas? i.e. If (X=(Y-1) or (Y-2) or (Y+1) or (Y+2)
then result = 11

Any other ideas is also greatly appreciated
Thanks in advance


=IF(OR(MOD(ABS(A1-B1)/2,1)<0,ABS(A1-B1)22),0,12-ABS(A1-B1)/2)


You may have missed the later part of the question, Nick? I think your formula gives a zero result if the difference is an odd
number. The OP wanted an answer of 11 if the difference is +/-2 *or* +/- 1.
--
David Biddulph