sumif with the criterion of what to sum in a different cell

essta

New Member
Joined
Jun 19, 2019
Messages
5
Thank you so much for the opportunity to ask questions of the experts (I hope my Q wont be too primitive ). I am summing a column of numbers, using sumif, to only sum the pay of the hourly workers. I typed in the function to do that, and believe it or not it works. But I need the user to be able to choose what to sum by clicking a cell that specifies the criterion of what to sum eg. hourly or salaried. If I rewrite the function each time replacing the criterion, it works, but it won't do. If the choice (criteria) of what they want totaled is located in some cells outside the table, I need to bring that choice into the function. It does work if I use a cell reference ie j4 instead of "hourly" but I still need the j4 or j5 to get into the function.Thank you so much!Essta
 
In G6, run Data Validation and select "List" and then type your two options, separated by a comma.
 
Upvote 0

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,215,826
Messages
6,127,122
Members
449,361
Latest member
VBquery757

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