ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   if declaration (https://www.excelbanter.com/excel-programming/351834-if-declaration.html)

ashw1984

if declaration
 
i am trying to test whether "e7" is within a "h7"% of "b7"
If Abs((Range("b7").Value) / (Range("e7").Value)) < ((Range("h9").Value) /
100) Then
can anybody suggest why this does not work
and/or how to do this thank's



Toppers

if declaration
 
Hi,
Assuming H7 contains a % then:

If Abs((Range("b7").Value) - (Range("e7").Value)) <= Range("h7").Value *
Range("b7") Then

"ashw1984" wrote:

i am trying to test whether "e7" is within a "h7"% of "b7"
If Abs((Range("b7").Value) / (Range("e7").Value)) < ((Range("h9").Value) /
100) Then
can anybody suggest why this does not work
and/or how to do this thank's



Bob Phillips[_6_]

if declaration
 
If Abs((Range("B7").Value * (1 + Range("H7").Value / 100))) =
Range("E7").Value And _
Abs((Range("B7").Value * (1 - Range("H7").Value / 100))) <=
Range("E7").Value Then
MsgBox "yes"
End If


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"ashw1984" wrote in message
...
i am trying to test whether "e7" is within a "h7"% of "b7"
If Abs((Range("b7").Value) / (Range("e7").Value)) < ((Range("h9").Value) /
100) Then
can anybody suggest why this does not work
and/or how to do this thank's






All times are GMT +1. The time now is 05:02 AM.

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