Calculating Column Based Names

Casp

New Member
Joined
Jul 24, 2021
Messages
16
Office Version
  1. 2019
Platform
  1. Windows
Hello,

I have a formula (below) that I put in a cell to test a sum calculation. I am using named ranges and have a dropdown list that has: All Departments, dept.1, dept2., dept3., etc etc etc. I plan to put this into a table.

This is what I have working so far in my test cells:
- In my dropdown, If I select all departments, it should calculate everything in the sold column for all departments
- To get total sold for users (will be put in table for comparison purposes), if I select a specific department, it calculates everything in the sold column for that specific department and the user listed for it

Excel Formula:
=SUM(SUMIFS(Sold,Users,{"Keith"},Department,DeptSelect),IF(DeptSelect="All Departments",SUM(Sold,Users,{"*Keith*"})))

Need help with:
- When I select all departments from my dropdown (named DeptSelect), then it should show the total of everything in the sold column for the specific user listed for it. The same user can be listed for different departments. I tried adding to the statement but the result was 0 and I believe I understand why but need to get the right syntax.

- I would like to calculate the sum of sold items by month or range of months (for example january and february) per user, per department. So for example, user Keith has 31 sold items for January but over time has 97 things sold.

I plan to have another table with the users in it and what theyve sold to compare monthly, quarterly etc.

Book1
ABCD
1DateDepartmentSold
21/6/2021Dept. 116Keith
31/6/2021Dept. 27John
41/7/2021Dept. 315Keith
52/1/2021Dept. 145Tammy
62/2/2021Dept. 266John
72/3/2021Dept. 332Tammy
82/4/2021Dept. 466Keith
Sheet1


Thanks for any advice/help!
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
How about
Excel Formula:
=SUMIFS(sold,Users,"Keith",Department,IF(DeptSelect="All departments","*",DeptSelect))
 
Upvote 0
Solution
Thank you Fluff! That worked perfectly! Seems like SUMIFS was the only thing needed since it caters to multiple arguments/criteria. If I had another dropdown that listed every month, can I use EOMONTH in the formula above with the further condition to sum based on how many sold per month per user (hope that makes sense)?
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,262
Members
452,627
Latest member
KitkatToby

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