Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Comparing Values from 2 cells
I working on a form where there is a Value in cell B89 and there is a value
in cell F90. I need excel to determin if the value in F90 falls in the range of the value for cell B89.. example: cell B89 value = 3.5 - 5.0 (not minus sign) this values also changes... Cell F90 value (user entered value) = 4.5 i need excel to see if 4.5 falls in the range of 3.5 - 5.0 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Comparing Values from 2 cells
Reggie,
Try this: e.g in Cell A1 put "=IsInRange(B89,F90)" (no quotes) and function will return TRUE or FALSE. in VBA: Dim Check as boolean Check=isInRange(Range("B89"),range("F90")) Function IsInRange(ByRef rng As Range, cv As Range) As Boolean Dim lv As Double, uv As Double lv = CDec(Left(rng.Value, InStr(1, rng, "-") - 1)) uv = CDec(Right(rng.Value, InStrRev(rng, "-") - 1)) If cv.Value = lv And cv.Value <= uv Then IsInRange = True Else IsInRange = False End If End Function HTH "Reggie" wrote: I working on a form where there is a Value in cell B89 and there is a value in cell F90. I need excel to determin if the value in F90 falls in the range of the value for cell B89.. example: cell B89 value = 3.5 - 5.0 (not minus sign) this values also changes... Cell F90 value (user entered value) = 4.5 i need excel to see if 4.5 falls in the range of 3.5 - 5.0 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Comparing Values from 2 cells
Obviously you mean the value in B89 is a string containing two numbers
separated by a space-dash-space. Those two numbers really should be put into two individual cells, but if this cannot be done then...(here goes)...try this crazy formula: =IF(AND(F90=VALUE(LEFT(B89,FIND(" - ",B89)-1)),F90<=VALUE(RIGHT(B89,LEN(B89)-FIND(" - ",B89)-2))),"YES","NO") "Reggie" wrote: I working on a form where there is a Value in cell B89 and there is a value in cell F90. I need excel to determin if the value in F90 falls in the range of the value for cell B89.. example: cell B89 value = 3.5 - 5.0 (not minus sign) this values also changes... Cell F90 value (user entered value) = 4.5 i need excel to see if 4.5 falls in the range of 3.5 - 5.0 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Comparing the values in two cells, then counting how many differ | Excel Worksheet Functions | |||
Help with Comparing values and retrieving values in Excel!!!!!! | Excel Worksheet Functions | |||
Iterating through cells, comparing values | Excel Programming | |||
Comparing values in two columns and displaying missing values in n | Excel Programming | |||
Comparing values in non contigious cells | Excel Programming |