Count the occurrence with the array formula

mohsinbipu

New Member
Joined
Feb 19, 2021
Messages
17
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
  2. Web
Hello Excel lovers,
For a better understanding, please find the picture. Here,
  • my input Column is I, J, K
  • My output column is the P column (I want to get the Xlookup result for nth number.)
  • To count the number of occurrences, I add a helper column L

I don't want to add this helper column. I want to get the result directly from the input. So, as per my understanding, If I can get the number of occurrences with the array formula I don't need this helper column.

How I get this number of occurrences:
This is a bit tricky. To count the number of occurrences, I need to consider style ( I Column) and Qty ( K Column)

Example:-
Let's consider, Yellow highlighted Qty-209 (row-04). There are 04 times in this sheet. But 02 times for style 676841 02 and 02 times for 676841 04

So, for style 676841 02, the number of occurrences will be
  • "1" in row 04 and "2" in row 11.

again for 676841 04, the number of occurrences will be
  • "1" in row 12 and "2" in row 14.
Count the occurrence with the array formula.xlsx
IJKLMNOP
1
2InputOutput column
3StyleDateQtyCount Helper columnStyleQtyDate
4676841 0216.01.20242091676841 0227912.01.2024
5676841 0215.01.20242991676841 0229915.01.2024
6676841 0212.01.20242761676841 0229818.01.2024
7676841 0212.01.20242791676841 0227612.01.2024
8676841 0216.01.20242992676841 0220916.01.2024
9676841 0218.01.20242981676841 0229916.01.2024
10676841 0213.01.20242762676841 0227613.01.2024
11676841 0213.01.20242092676841 0220913.01.2024
12676841 0416.01.20242091
13676841 0415.01.20242991
14676841 0412.01.20242092
15676841 0412.01.20242791
16676841 0516.01.20241641
17676841 0518.01.20242981
18676841 0513.01.20241731
19676841 0513.01.20242861
Sheet1
Cell Formulas
RangeFormula
P4:P11P4=XLOOKUP(N4 & O4 & COUNTIFS($O$4:O4, O4), I:I & K:K & L:L, J:J)
L4:L19L4=COUNTIFS($K$4:K4, K4, $I$4:I4, I4)
 
Last edited:

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
1705397693146.png
1705397705101.png
 
Upvote 0
How about
Excel Formula:
=CHOOSEROWS(FILTER($J$4:$J$1000,($I$4:$I$1000=N4)*($K$4:$K$1000=O4)),COUNTIFS(N$4:N4,N4,O$4:O4,O4))
 
Upvote 0
Solution

Forum statistics

Threads
1,224,259
Messages
6,177,482
Members
452,782
Latest member
ZCapitao

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