#1   Report Post  
macrodummy
 
Posts: n/a
Default elseif formula

I am trying to write a formula that would look at D2 and compare it to
determine the value of F2 on the attached sheet. I have tried sumif, elseif
etc... and cannot get this to work. Please help!!!

Need formulas for individual and family

Weekly Hours Emp Cost Individual Emp Cost Family
19 #REF!
21
35
29
39

Compare to this for cost

# of Hrs Individual Family
40 $37.71 $83.62
38 $41.72 $92.51
36 $45.73 $101.40
35 $47.73 $105.84
34 $49.73 $110.28
32 $53.74 $119.17
30 $57.75 $128.06
28 $61.76 $136.00
26 $65.77 $145.83
24 $69.78 $154.72
22 $73.78 $163.61
20 $77.79 $172.49

1st
formula:=IF(D239,L2)(D237<39,L3)(D236<37,L4)(D2 35<36,L5)(D234<35,L6)(D232<34,L7)(D230<32,L8)( D228<30,L9)(D226<28,L10)(D224<26,L11)(D222<24, L12)(D220<22,L13)

2nd formula:
If Weekly Hours = 40 Then
Emp Cost Individual = L2
ElseIf Weekly Hours = 38 Then
Emp Cost Individual = L3
ElseIf Weekly Hours = 38 Then
Emp Cost Individual = L4
ElseIf Weekly Hours = 38 Then
Emp Cost Individual = L5
ElseIf Weekly Hours = 38 Then
Emp Cost Individual = L6
ElseIf Weekly Hours = 38 Then
Emp Cost Individual = L7
ElseIf Weekly Hours = 38 Then
Emp Cost Individual = L8
ElseIf Weekly Hours = 38 Then
Emp Cost Individual = L9
ElseIf Weekly Hours = 38 Then
Emp Cost Individual = L10
ElseIf Weekly Hours = 38 Then
Emp Cost Individual = L11
ElseIf Weekly Hours = 38 Then
Emp Cost Individual = L12
ElseIf Weekly Hours = 38 Then
Emp Cost Individual = L13

Weekly Hours <= 19
End If
End Function




  #2   Report Post  
Duke Carey
 
Posts: n/a
Default

Sort your table in ascending order on the hours, then use for the individual
cost

=VLOOKUP(hours,table,2)

change the 2 to a 3 to get the family cost


"macrodummy" wrote:

I am trying to write a formula that would look at D2 and compare it to
determine the value of F2 on the attached sheet. I have tried sumif, elseif
etc... and cannot get this to work. Please help!!!

Need formulas for individual and family

Weekly Hours Emp Cost Individual Emp Cost Family
19 #REF!
21
35
29
39

Compare to this for cost

# of Hrs Individual Family
40 $37.71 $83.62
38 $41.72 $92.51
36 $45.73 $101.40
35 $47.73 $105.84
34 $49.73 $110.28
32 $53.74 $119.17
30 $57.75 $128.06
28 $61.76 $136.00
26 $65.77 $145.83
24 $69.78 $154.72
22 $73.78 $163.61
20 $77.79 $172.49

1st
formula:=IF(D239,L2)(D237<39,L3)(D236<37,L4)(D2 35<36,L5)(D234<35,L6)(D232<34,L7)(D230<32,L8)( D228<30,L9)(D226<28,L10)(D224<26,L11)(D222<24, L12)(D220<22,L13)

2nd formula:
If Weekly Hours = 40 Then
Emp Cost Individual = L2
ElseIf Weekly Hours = 38 Then
Emp Cost Individual = L3
ElseIf Weekly Hours = 38 Then
Emp Cost Individual = L4
ElseIf Weekly Hours = 38 Then
Emp Cost Individual = L5
ElseIf Weekly Hours = 38 Then
Emp Cost Individual = L6
ElseIf Weekly Hours = 38 Then
Emp Cost Individual = L7
ElseIf Weekly Hours = 38 Then
Emp Cost Individual = L8
ElseIf Weekly Hours = 38 Then
Emp Cost Individual = L9
ElseIf Weekly Hours = 38 Then
Emp Cost Individual = L10
ElseIf Weekly Hours = 38 Then
Emp Cost Individual = L11
ElseIf Weekly Hours = 38 Then
Emp Cost Individual = L12
ElseIf Weekly Hours = 38 Then
Emp Cost Individual = L13

Weekly Hours <= 19
End If
End Function




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
IF formula? meris Excel Worksheet Functions 1 September 6th 05 08:14 AM
writing a formula for a colored value aaronwexler New Users to Excel 11 September 1st 05 04:11 PM
referencing named formula using INDIRECT function [email protected] Excel Worksheet Functions 19 May 11th 05 10:48 AM
Simplify formula Luke Excel Worksheet Functions 37 May 6th 05 08:21 AM
Match / Vlookup within an Array formula Hari Prasadh Excel Discussion (Misc queries) 3 February 3rd 05 05:37 PM


All times are GMT +1. The time now is 04:41 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"