Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thank you Harlan & Rick
I was far away from it. J@@ Rick Rothstein (MVP - VB) wrote: Can you explain the Abs formula? It works fine, but how does it?? Thank you J@@ (Tahiti) Dana DeLouis wrote: =ABS(A1-267)<114 =IF(A1153,A1<381) =AND(A1153,A1<381) Harlan has given you the mathematics of the formula... let's see if a verbal description helps any. First off, if you are not familiar with the ABS function, it simply returns the positive value of its argument, So, ABS(5)=5 and ABS(-5)=5. Now, consider the range given = 153 to 381. The midpoint of that range is 267 which can be found by adding one half the length of the range to the lower range value. Midpoint = 153 + (381 - 153) / 2 = 153 + 114 = 267 As it happens, the short cut for this calculation is to add the endpoints of the range together and divide by 2 Midpoint = (153 + 381) / 2 = 534 / 2 = 267 which is what Harlan used. Then math behind that is quite simple. Starting with my original method of calculating the midpoint (and using A and B for the endpoints of the range)... Midpoint = A + (B - A) / 2 = A + B/2 - A/2 = A/2 + B/2 = (A + B) / 2 Anyway, the main point to see in this is that all values in the range must lie within half the length of the range from the midpoint. If you don't see that at first, think about it... it is sort of a definition. So, if a value V is to be in the range, then it must be closer to the midpoint than an end point is. Said another way, the positive difference between V and the midpoint must be less than half the length of the range. For the given range, the positive difference of V and the Midpoint is found by ABS(V-267) and it must be less than half the length of the range which is (381-153)/2... note that is the second math expression in my original Midpoint calculation above... which is 114 after completing the math. Okay, now put it together.. for the value V to be in the range, this expression must hold... ABS(V - 267) < 114 For the spreadsheet... A1 is the value V. One final note. If we use just the "less than" symbol (<), the endpoints are not part of the range. If we use the "less than or equal" symbol (<=), then the endpoints are part of the range. In looking back at what I wrote, I don't think it came out as clear as how I see it in my head; but perhaps you will find it useful nonetheless. Rick |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formula Help - Perform a calculation only if the result falls between 2 values | Excel Discussion (Misc queries) | |||
Create formula-if value A falls between values B and C in time for | Excel Discussion (Misc queries) | |||
Function that returns the page number a cell falls on | Excel Worksheet Functions | |||
Countif if the value falls between 2 other values | New Users to Excel | |||
Formula to determine whether number falls within range?? | Excel Worksheet Functions |