Need help with extracting data without using Array-function

zulkir

New Member
Joined
Dec 2, 2017
Messages
4
I have some 10k lines in both VAN and SHOPS column. Sometimes the Vans go to wrong shop so I would like to know how many times a van went to a certain shop .
Source:
DateVANSSHOPS
30/11/2017VAN1SHOP1
30/11/2017VAN1SHOP2
30/11/2017VAN1SHOP1
30/11/2017VAN1SHOP3
30/11/2017VAN1SHOP1
30/11/2017VAN2SHOP4
01/12/2017VAN2SHOP4
01/12/2017VAN2SHOP5
01/12/2017VAN2SHOP6
01/12/2017VAN3SHOP7

<tbody>
</tbody>


The result should be like this
VAN1VAN1-SHOP (cases)VAN2VAN2-SHOP (cases)VAN3VAN3-SHOP (cases)
SHOP13SHOP42SHOP71
SHOP21SHOP51
SHOP31SHOP61

<tbody>
</tbody>

Pivot table consists of blank cells so I can't do further data manipulation. At the moment I can't use any formulas using arrays, it just shows the formula, tried all solutions found by google incl ctrl+ ', no-text format, click to the formula, check {} etc.
Anyone can help, without using arrays?
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
In advance you don't know if like Van1 has only 3 shops, so you have run COUNTIFS for all the shops (cc 100) and the result is the some you get using a pivot table where you have tons of blank cells and a few with data. Thanks thou :)
 
Upvote 0
I have my data set including headers in A1:C11, just so you can reference any adjustments you need to fit your needs.
I then have my VAN1 in cell A14

In A15 copied down

Code:
=IFERROR(LOOKUP(2, 1/((COUNTIF($A$14:A14, $C$2:$C$11)=0)*($B$2:$B$11=$A$14)), $C$2:$C$11), "")

This is not an array formula, it will create a unique list in the order they appear.

Then just COUNTIFS next to it

Code:
=IF(A15="", "", COUNTIFS($B$2:$B$11, $A$14, $C$2:$C$11, A15))



Book1
ABC
1DateVANSSHOPS
230/11/2017VAN1SHOP1
330/11/2017VAN1SHOP2
430/11/2017VAN1SHOP1
530/11/2017VAN1SHOP3
630/11/2017VAN1SHOP1
730/11/2017VAN2SHOP4
801/12/2017VAN2SHOP4
901/12/2017VAN2SHOP5
1001/12/2017VAN2SHOP6
1101/12/2017VAN3SHOP7
12
13
14VAN1
15SHOP13
16SHOP31
17SHOP21
18  
19  
Sheet4
Cell Formulas
RangeFormula
A15=IFERROR(LOOKUP(2, 1/((COUNTIF($A$14:A14, $C$2:$C$11)=0)*($B$2:$B$11=$A$14)), $C$2:$C$11), "")
A16=IFERROR(LOOKUP(2, 1/((COUNTIF($A$14:A15, $C$2:$C$11)=0)*($B$2:$B$11=$A$14)), $C$2:$C$11), "")
A17=IFERROR(LOOKUP(2, 1/((COUNTIF($A$14:A16, $C$2:$C$11)=0)*($B$2:$B$11=$A$14)), $C$2:$C$11), "")
A18=IFERROR(LOOKUP(2, 1/((COUNTIF($A$14:A17, $C$2:$C$11)=0)*($B$2:$B$11=$A$14)), $C$2:$C$11), "")
A19=IFERROR(LOOKUP(2, 1/((COUNTIF($A$14:A18, $C$2:$C$11)=0)*($B$2:$B$11=$A$14)), $C$2:$C$11), "")
B15=IF(A15="", "", COUNTIFS($B$2:$B$11, $A$14, $C$2:$C$11, A15))
B16=IF(A16="", "", COUNTIFS($B$2:$B$11, $A$14, $C$2:$C$11, A16))
B17=IF(A17="", "", COUNTIFS($B$2:$B$11, $A$14, $C$2:$C$11, A17))
B18=IF(A18="", "", COUNTIFS($B$2:$B$11, $A$14, $C$2:$C$11, A18))
B19=IF(A19="", "", COUNTIFS($B$2:$B$11, $A$14, $C$2:$C$11, A19))



HTH

EDIT: Added HTMLMaker content
 
Last edited:
Upvote 0
As an alternative to LOOKUP, and given you have a version of Excel which has the AGGREGATE function, you can use

Code:
=IFERROR(INDEX($C$1:$C$11, AGGREGATE(15,6, (ROW($B$1:$B$11)-ROW($B$1)+1)/(($B$1:$B$11=$A$14)*(COUNTIF($A$14:A14, $C$1:$C$11)=0)), 1)), "")

This seems to give a more accurate result. Again, not an array function so just enter it ;)
 
Upvote 0
Another option...not an array function

B17
=SUMPRODUCT(--($C$2:$C$11=A17),--($B$2:$B$11=$B$2:$B$11))

OR

B17 =SUMPRODUCT(--($C$2:$C$11=A17),--($B$2:$B$11=$A$16))


ABCDEF
1DateVANSSHOPS
230/11/17VAN1SHOP1
330/11/17VAN1SHOP2
430/11/17VAN1SHOP1
530/11/17VAN1SHOP3
630/11/17VAN1SHOP1
730/11/17VAN2SHOP4
801/12/17VAN2SHOP4
901/12/17VAN2SHOP5
1001/12/17VAN2SHOP6
1101/12/17VAN3SHOP7
12
13
14
15
16VAN1VAN1-SHOP (cases)VAN2VAN2-SHOP (cases)VAN3VAN3-SHOP (cases)
17SHOP13SHOP42SHOP71
18SHOP21SHOP51
19SHOP31SHOP61

<tbody>
</tbody>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,698
Members
448,979
Latest member
DET4492

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