ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   + or - ? (https://www.excelbanter.com/excel-discussion-misc-queries/175686-a.html)

M.A.Tyler

+ or - ?
 
=IF(A1=B1,TRUE,FALSE), easy enough, but how about A1 being within .5 of B1?
In other words if B1=5, the statement would be true if A1=anywhere from 4.5
- 5.5.

is there a way to write this formula?

Thanks!

M.A.Tyler

Ron Coderre

+ or - ?
 
Try this:

=ABS(+B1-A1)<=0.5

Does that help?
Post back if you have more questions.
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"M.A.Tyler" <Great Lakes State wrote in message
...
=IF(A1=B1,TRUE,FALSE), easy enough, but how about A1 being within .5 of
B1?
In other words if B1=5, the statement would be true if A1=anywhere from
4.5
- 5.5.

is there a way to write this formula?

Thanks!

M.A.Tyler




Tyro[_2_]

+ or - ?
 
One way:

=AND(A1=B1-.5,A1<=B1+.5)

Tyro

"M.A.Tyler" <Great Lakes State wrote in message
...
=IF(A1=B1,TRUE,FALSE), easy enough, but how about A1 being within .5 of
B1?
In other words if B1=5, the statement would be true if A1=anywhere from
4.5
- 5.5.

is there a way to write this formula?

Thanks!

M.A.Tyler




Pete_UK

+ or - ?
 
Try this:

=IF(ABS(B1)-ABS(A1)<=0.5,TRUE,FALSE)

or even:

=(ABS(B1)-ABS(A1))<=0.5

Hope this helps.

Pete

On Feb 6, 1:36*am, M.A.Tyler <Great Lakes State wrote:
=IF(A1=B1,TRUE,FALSE), easy enough, but how about A1 being within .5 of B1?
In other words if B1=5, the statement would be true if A1=anywhere from 4.5
- 5.5.

is there a way to write this formula?

Thanks!

M.A.Tyler



M.A.Tyler

+ or - ?
 
All good, thanks as always!

"Pete_UK" wrote:

Try this:

=IF(ABS(B1)-ABS(A1)<=0.5,TRUE,FALSE)

or even:

=(ABS(B1)-ABS(A1))<=0.5

Hope this helps.

Pete

On Feb 6, 1:36 am, M.A.Tyler <Great Lakes State wrote:
=IF(A1=B1,TRUE,FALSE), easy enough, but how about A1 being within .5 of B1?
In other words if B1=5, the statement would be true if A1=anywhere from 4.5
- 5.5.

is there a way to write this formula?

Thanks!

M.A.Tyler




David Biddulph[_2_]

+ or - ?
 
No, Pete, because that would return true for any value of A1 <=-4.5 or
=+4.5 rather than for values between +4.5 and +5.5


You ned to change (ABS(B1)-ABS(A1)) to (ABS(B1-A1))
--
David Biddulph

"Pete_UK" wrote in message
...
Try this:

=IF(ABS(B1)-ABS(A1)<=0.5,TRUE,FALSE)

or even:

=(ABS(B1)-ABS(A1))<=0.5

Hope this helps.

Pete

On Feb 6, 1:36 am, M.A.Tyler <Great Lakes State wrote:
=IF(A1=B1,TRUE,FALSE), easy enough, but how about A1 being within .5 of
B1?
In other words if B1=5, the statement would be true if A1=anywhere from
4.5
- 5.5.

is there a way to write this formula?

Thanks!

M.A.Tyler




Pete_UK

+ or - ?
 
Right, David, thanks.

I thought I was checking for the difference of the magnitures, but
have now re-read the OP's request - that always helps !! <bg

Pete

On Feb 6, 8:16*am, "David Biddulph" <groups [at] biddulph.org.uk
wrote:
No, Pete, because that would return true for any value of A1 <=-4.5 or
*=+4.5 rather than for values between +4.5 and +5.5

You ned to change (ABS(B1)-ABS(A1)) to (ABS(B1-A1))
--
David Biddulph

"Pete_UK" wrote in message

...
Try this:

=IF(ABS(B1)-ABS(A1)<=0.5,TRUE,FALSE)

or even:

=(ABS(B1)-ABS(A1))<=0.5

Hope this helps.

Pete

On Feb 6, 1:36 am, M.A.Tyler <Great Lakes State wrote:



=IF(A1=B1,TRUE,FALSE), easy enough, but how about A1 being within .5 of
B1?
In other words if B1=5, the statement would be true if A1=anywhere from
4.5
- 5.5.


is there a way to write this formula?


Thanks!


M.A.Tyler- Hide quoted text -


- Show quoted text -




All times are GMT +1. The time now is 11:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com