ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   how do i set formula to be equal to a value plus or minus 1? (https://www.excelbanter.com/excel-worksheet-functions/123492-how-do-i-set-formula-equal-value-plus-minus-1-a.html)

Aaron

how do i set formula to be equal to a value plus or minus 1?
 
i want an if then statement. i have it now so that something happens if x =
y. well, i want the same thing to happen if x = y plus or minus 1. i found
that x is often within .1 or 1 of y and that is close enough for me to want
the something to happen. thanks.

ExcelBanter AI

Answer: how do i set formula to be equal to a value plus or minus 1?
 
Sure, I can help you with that!

To set a formula to be equal to a value plus or minus 1, you can use the IF function along with the ABS function to check if the absolute difference between x and y is less than or equal to 1. Here's an example formula:
  1. =IF(ABS(x-y)<=1, "Something", "Nothing")

In this formula, "x" and "y" are the cell references for the values you want to compare. The ABS function returns the absolute value of the difference between x and y, and the IF function checks if that value is less than or equal to 1. If it is, the formula returns "Something", otherwise it returns "Nothing".

You can replace "Something" and "Nothing" with any values or formulas you want to use.

I hope that helps! Let me know if you need any further assistance.

Ron Coderre

how do i set formula to be equal to a value plus or minus 1?
 
Maybe something like this:

For values in A1 and B1

C1: =IF((MAX(A1,B1)-MIN(A1,A1))<=1,"OK","Exceeds limit")

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Aaron" wrote:

i want an if then statement. i have it now so that something happens if x =
y. well, i want the same thing to happen if x = y plus or minus 1. i found
that x is often within .1 or 1 of y and that is close enough for me to want
the something to happen. thanks.


Teethless mama

how do i set formula to be equal to a value plus or minus 1?
 
=IF(ABS(A1-B1)<=1,"OK","Not OK")


"Aaron" wrote:

i want an if then statement. i have it now so that something happens if x =
y. well, i want the same thing to happen if x = y plus or minus 1. i found
that x is often within .1 or 1 of y and that is close enough for me to want
the something to happen. thanks.


Ron Coderre

how do i set formula to be equal to a value plus or minus 1?
 
Darn typos!

The formula should be:
C1: =IF((MAX(A1,B1)-MIN(A1,B1))<1,"OK","Exceeds limit")

Note: that works even if one or both of the numbers are negative.

(Sorry about the typo)
***********
Regards,
Ron

XL2002, WinXP


"Ron Coderre" wrote:

Maybe something like this:

For values in A1 and B1

C1: =IF((MAX(A1,B1)-MIN(A1,A1))<=1,"OK","Exceeds limit")

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"Aaron" wrote:

i want an if then statement. i have it now so that something happens if x =
y. well, i want the same thing to happen if x = y plus or minus 1. i found
that x is often within .1 or 1 of y and that is close enough for me to want
the something to happen. thanks.



All times are GMT +1. The time now is 03:36 PM.

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