Sort Unique Filter and Countifs

searchingforhelp

Board Regular
Joined
Nov 11, 2020
Messages
67
Office Version
  1. 365
Platform
  1. Windows
Hi, I hope all is well.

Need assistance with two separate formulas

1. There are a total of four locations listed in column A. I am trying to separate the locations and identify the theme with that location, and the number of times it occurred in a specified month. I am only able to identify the theme in column F and the monthly occurrence in column G, H and I but not the location. Looking for a formula that will provide me the location with the theme and column G, H and I. Something similar to the attached image if applicable. Please note the list is longer in Column A, in case you are wondering why the numbers are not adding up

2. Is there a way to simplify the formula in column G, H and I from the data listed in column C rather than using column D?


Example one.PNG. .


Mr Excel.xlsx
ABCDEFGHI
1LocationThemeDatesMonthThemeMayJuneJuly
2HawaiiFlowers7/28/2022JulDay Cruises021
3CaliforniaSequoia sempervirens5/7/2022MayFishing010
4HawaiiMusic7/4/2022JulFlowers001
5MaineLobster6/1/2022JunGrand Canyon110
6HawaiiHelicoptor tour5/17/2022MayHelicoptor tour200
7ArizonaGrand Canyon6/19/2022JunLobster011
8MaineLobster7/9/2022JulLuau100
9HawaiiLuau5/10/2022MayMusic001
10MaineFishing6/7/2022JunNavajo100
11HawaiiHelicoptor tour5/12/2022MayRed Mountains010
12CaliforniaSurfing7/4/2022JulSequoia sempervirens101
13ArizonaNavajo5/7/2022MaySurfing001
14MaineDay Cruises6/17/2022JunSwimming100
Sheet1
Cell Formulas
RangeFormula
F2:F14F2=SORT(UNIQUE(FILTER(B2:B6000,B2:B6000<>"")))
G2:G14G2=COUNTIFS(B:B,F2#,D:D,"May")
H2:H14H2=COUNTIFS(B:B,F2#,D:D,"Jun")
I2:I14I2=COUNTIFS(B:B,F2#,D:D,"Jul")
D2:D14D2=CHOOSE((MONTH(C2)),"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
Dynamic array formulas.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
E2=SORT(UNIQUE(FILTER(A2:B6000,(A2:A6000<>"")*(B2:B6000<>""))))
It will spill to column F.
If you change the formulas on Column D to "month(D2")", G2 will be set "=COUNTIFS($A:$A,$E2,$B:$B,$F2,$D:$D,COLUMN()-2)"
 
Upvote 0
Another option
Fluff.xlsm
ABCDEFGHIJ
1LocationThemeDatesMonthThemeMayJuneJuly
2HawaiiFlowers28/07/2022JulArizonaGrand Canyon010
3CaliforniaSequoia sempervirens07/05/2022MayArizonaNavajo100
4HawaiiMusic04/07/2022JulCaliforniaSequoia sempervirens100
5MaineLobster01/06/2022JunCaliforniaSurfing001
6HawaiiHelicoptor tour17/05/2022MayHawaiiFlowers001
7ArizonaGrand Canyon19/06/2022JunHawaiiHelicoptor tour200
8MaineLobster09/07/2022JulHawaiiLuau100
9HawaiiLuau10/05/2022MayHawaiiMusic001
10MaineFishing07/06/2022JunMaineDay Cruises010
11HawaiiHelicoptor tour12/05/2022MayMaineFishing010
12CaliforniaSurfing04/07/2022JulMaineLobster011
13ArizonaNavajo07/05/2022May
14MaineDay Cruises17/06/2022Jun
Report
Cell Formulas
RangeFormula
F2:G12F2=SORT(UNIQUE(FILTER(A2:B6000,A2:A6000<>"")),{1,2})
H2:J12H2=COUNTIFS($A:$A,INDEX($F2#,,1),$B:$B,INDEX($F2#,,2),$D:$D,LEFT(H1,3))
D2:D14D2=TEXT(C2,"mmm")
Dynamic array formulas.
 
Upvote 0
Solution
E2=SORT(UNIQUE(FILTER(A2:B6000,(A2:A6000<>"")*(B2:B6000<>""))))
It will spill to column F.
If you change the formulas on Column D to "month(D2")", G2 will be set "=COUNTIFS($A:$A,$E2,$B:$B,$F2,$D:$D,COLUMN()-2)"

Hi Takae and Fluff, thank you for the assistance. I noticed the data has to be exact in order for the formula to work. What would help is if the formula can find the columns and provide the same data. If there is data in column B, the formula is capturing column A, B and C resulting in a spill (See example one). I need the formula to capture wherever the column is, in the sheet. The second issue is similar to the first. If there is data between the formula for the months (e.g., column E, F) the formula in column I, J and K is incorrect (see example two). I need the formula to capture wherever the column is, in the sheet.

I hope this is exampled clearly and thank you for your help :)
 

Attachments

  • Example one.PNG
    Example one.PNG
    60.6 KB · Views: 10
  • Example two.PNG
    Example two.PNG
    73 KB · Views: 10
Upvote 0
In that case can you please post some realistic data for what you actually have.
 
Upvote 0
Glad you sorted it & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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