Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Need help on IF condition

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Need help on IF condition

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

--
urkec


" wrote:

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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to SUM on a condition? trant Excel Worksheet Functions 2 April 2nd 09 12:32 AM
lookup with multiple condition, but one condition to satisfy is en Eddy Stan Excel Worksheet Functions 2 October 27th 07 02:06 PM
Combine an OR condition with an AND condition Will Excel Discussion (Misc queries) 1 April 6th 07 03:52 PM
Condition 1 overules condition 2? Bultgren Excel Worksheet Functions 2 January 20th 06 12:29 PM
I need 4 condition for condition formatting SeeKY Excel Programming 2 June 7th 05 09:41 AM


All times are GMT +1. The time now is 04:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"