Share via

Unique(Filter( criteria between values help

Anonymous
2025-02-25T04:31:00+00:00

Greetings,

I am trying to make a macro to speed up my operations, but I am hitting a wall min my formula knowledge and can't figure out what key words track down the info I want.

Short version: I want to find the sum of Unique Items w/ their unique locations filtered by their department

I can get data if I use =Unique(Filter(B:C,A:A<3000)) for the smaller department range
however if I try using =Unique(Filter(B:C,3000

Example Data Set below

Department Item Number Location Sum
2000 555 75b6 5
2010 555 75b6 5
2030 555 75b6 10
2050 556 77b3 5
2080 555 75b6 10
22100 632 66b1 6
2030 554 77b4 15
3001 114 55b9 4
3030 114 55b9 8
33300 800 55b3 2

Results from the formulas

=UNIQUE(FILTER(B:C,A:A<3000)) =UNIQUE(FILTER(B:C,3000
555 75b6 30 #CALC!
556 77b3 5
554 77b4 15
0 0 0

With Good Fortune,
Pirate

Microsoft 365 and Office | Excel | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

6 answers

Sort by: Most helpful
  1. Ashish Mathur 102K Reputation points Volunteer Moderator
    2025-02-25T23:06:09+00:00

    Hi,

    In cell F4, enter this formula

    =GROUPBY(B4:C13,D4:D13,SUM,,0,,((A4:A13>=G1)*(A4:A13<=G2)))

    Hope this helps.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2025-02-25T22:36:03+00:00

    This is probably not what you want, but as a side note. It is very easy as a dynamic worksheet function.

    Expanding in the horizontal direction however requires another step.

    Image

    Was this answer helpful?

    0 comments No comments
  3. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2025-02-25T08:03:15+00:00

    While that is an option, its not exactly what I need. Using a pivot table, it is looking at all of the departments (it just needs to be 2000-3000, 3000-4000, etc), not every Department and sub-department

    Is there a way to have it filter by the range for the Department to it results in something closer to

    You can set a filter in a Pivot table. A comfortable way is to use slicers.

    Use slicers to filter data - Office Support

    Andreas.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2025-02-25T05:31:37+00:00

    Greetings,

    While that is an option, its not exactly what I need. Using a pivot table, it is looking at all of the departments (it just needs to be 2000-3000, 3000-4000, etc), not every Department and sub-department

    Is there a way to have it filter by the range for the Department to it results in something closer to

    Department 2 (2000-3000) Department 3 (3000-4000) Department 22 (22000-33000)
    555 75b6 30 114 55b9 12 632 66b1 6
    556 77b3 5
    554 77b4 15

    Was this answer helpful?

    0 comments No comments
  5. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2025-02-25T04:51:29+00:00

    Use a pivot table.

    Create a PivotTable to analyze worksheet data - Office Support

    Drag "Item Number" and Location into the rows section, Sum into the values section, done.

    Andreas.

    Was this answer helpful?

    0 comments No comments