constructing a sumif statement based on dropdown lists

Rameses

Board Regular
Joined
Mar 3, 2010
Messages
137
Hi all

I wish to create a sum formula based on if statements and using dropdown boxes

my worksheet has 2 headings
A1 Staff
B1 Time
C1 Cost

Row 2 onwards for Column A and Column B are based on dropdown lists
A2 Dropdown list is CT, TA, AEN
B2 Dropdown list is 1, 0.75, 0.5, 0.25
In C2 I want to work out the total cost

In E2:E4 is a list of the Staff
E2 CT
E3 TA
E4 AEN

In F2:F4 is a list of the Costs per Hour
F2 30
F3 14
F4 11

I want to put in a formula into column C that will say for example
if A2 =CT, and B2 =0.75 then Cost =F2*B2 Therefore C1 should =22.5

I hope this makes sense

Thanks for any help

Rameses

Worked example below
[TABLE="width: 300"]
<TBODY>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]STAFF[/TD]
[TD]TIME[/TD]
[TD]COST[/TD]
[TD][/TD]
[TD]Staff[/TD]
[TD]Hourly Cost[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]CT[/TD]
[TD]0.75[/TD]
[TD]22.5[/TD]
[TD][/TD]
[TD]CT[/TD]
[TD]30[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]AEN[/TD]
[TD]0.5[/TD]
[TD]5.50[/TD]
[TD][/TD]
[TD]TA[/TD]
[TD]14[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]TA[/TD]
[TD]1[/TD]
[TD]14[/TD]
[TD][/TD]
[TD]AEN[/TD]
[TD]11[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</TBODY>[/TABLE]
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Would that not be an If function:

Try this formula in the cell which needs the desired output.

=IF(AND(A2="CT",B2="0.75"),F2*B2,"")
 
Upvote 0
Thanks for getting back to me

I have reworked your example to be =IF(AND(A2,B2),F2*B2,"")

Whilst that works for the first example it does not work for the rest as it does not
recognise the change in cost for the other types of staff l. I know this is something to do with the use of dropdowns and linking the staff member to the cost before working out C.

any ideas?








Would that not be an If function:

Try this formula in the cell which needs the desired output.

=IF(AND(A2="CT",B2="0.75"),F2*B2,"")
 
Upvote 0
I have broken up and examined suggested forumla again
the issues it brings are that it fails to recognise
a) change in drop down for staff
b) difference in cost for staff if staff is changed ie, CT to AEN
c) change in drop down for time

any ideas anyone?
 
Upvote 0
This formula:

=IF(AND(A2,B2),F2*B2,"")

What is the purpose of AND function? You have assigned 2 cells A2 and B2 but you have not given any conditions for them so even if you change the drop downs you will always get F2*B2.

Look at this sample below and see if this is what you need, formulas are at the bottom which need to be entered in Cell C2 and dragged down.


Excel 2003
ABCDE
1STAFFTIMECOSTStaffHourly Cost
2CT0.7522.5CT30
3TA0.57.0TA14
4AEN111.0AEN11
Sheet1
Cell Formulas
RangeFormula
C2=INDEX($E$2:$E$4,MATCH(A2,$D$2:$D$4,0))*B2
C3=INDEX($E$2:$E$4,MATCH(A3,$D$2:$D$4,0))*B3
C4=INDEX($E$2:$E$4,MATCH(A4,$D$2:$D$4,0))*B4
 
Upvote 0

Forum statistics

Threads
1,223,248
Messages
6,171,027
Members
452,374
Latest member
keccles

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top