View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
Bernard Liengme
 
Posts: n/a
Default Complicated formula help required

I am reading the question differently from Niek
My take is:
x is within y +- 2 result is 11
x is within y +- 4 result is 10
This seems to work =INT(12-ABS(x-y)/2)*(ABS(x-y)<24)
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"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
Recklaw


--
recklaw
------------------------------------------------------------------------
recklaw's Profile:
http://www.excelforum.com/member.php...o&userid=32469
View this thread: http://www.excelforum.com/showthread...hreadid=524494