LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default multiple "IF" statements in function

I tried to put your suggestion into the function line in Excel with no luck.
I opened the VB editor and put in the folowing:
If col(e) <= (365) Then
col(f) = "0 weeks"
Else
if col(e) (360) and <= (720) then
col(f) = "1 Week"
Else
if col (e) (720) and <= (1800) then
col(f) = "2 Weeks"
Else
if col (e) (1800) and <= (3600) then
col(f) = "3 Weeks"
Else
If col(e) (3600) Then
col(f) = "4 Weeks"
I get an error on the "<=" and I'm wondering if col(e) is the right way to
assign the function to colmn E

"Atif" wrote:

replace first 4 Endif with Else

"RRyan" wrote:

I'm trying to build a vacation tracker but i don't know VB. Is there a way
to get muliple if statements using the function built into excel? This is
what I would ike to use:
If (e) <= (365) Then
(f)= "0 Weeks"
End If
if (e) (365) and <= (730) then
(f) = "1 week"
End If
if (e) (730) and <= (1825) then
(f) = "2 Weeks"
End If
if (e) (1825) and <= (3650) then
(f) = "3 Weeks"
End If
If (e) (3650) Then
(f) = "4 Weeks"
End If
(e) and (f) are the columns
Thanks in advance
Rob

 
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
Text "comparison" operator for "contains" used in an "IF" Function Pawaso Excel Worksheet Functions 4 April 4th 23 11:35 AM
Multiple "IF" statements in a formula lawandgrace Excel Discussion (Misc queries) 1 June 2nd 09 05:55 PM
Creating an "If" Function with multiple "if"s SchizJoe Excel Worksheet Functions 3 April 6th 09 07:55 PM
How can I have multiple "If" statements in one formula? MikeL Excel Discussion (Misc queries) 5 January 15th 06 03:36 AM
Multiple "IF" statements every cell in range cbrd[_28_] Excel Programming 6 January 11th 06 02:23 PM


All times are GMT +1. The time now is 08:21 AM.

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

About Us

"It's about Microsoft Excel"