Need help on IF condition

R

rajasekhar.goud

I have been researching on if condition, but unable to get it work,

I have to write a IF comnditon for the folowing,

Dollars Points

$3.0 1
$4.0 2
$5.0 3
$6.0 4
$7.0 5
$8.0 6
$9.0 7
$10.0 8


If $ value is =3 then 1
if $ value is >=3.5 and <4 then 2
iif $ value is >=4.5 and <5 then 3

like wise,

If not possible with IF condition, please let me know for alternative
formule,

please help
 
J

JE McGimpsey

What happens between 4 and 4.5?

One way, if I understand you correctly:

=ROUND(A1,0) - 2
 
U

urkec

You can use select case (adjust case clauses )

Dim Dollars As Currency
Dim Points As Integer

Dollars = 7.3

Select Case Dollars
Case 0.1 To 3.5
Points = 1
Case 3.6 To 4.5
Points = 2
Case 4.6 To 5.5
Points = 3
Case 5.6 To 6.5
Points = 4
Case 6.6 To 7.5
Points = 5
Case 7.6 To 8.5
Points = 6
Case 8.6 To 9.5
Points = 7
Case 9.6 To 10
Points = 8
Case Else
Points = 0
End Select

MsgBox Points
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top