View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
RussellT RussellT is offline
external usenet poster
 
Posts: 38
Default multiple "IF" statements in function

Try using a lookup table instead.
ColA ColB ColC
1 365 0 weeks
366 730 1 week
731 1825 2 weeks
1826 3650 3 weeks
3650 999999 4 weeks

(Cell A100) (Cell B100) (Cell C100)
Employee Days Employee Weeks of Vaca
AA 739 =vlookup(B100,$A$1:$C$5,3,False)

"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