Schoots

New Member
Joined
Apr 12, 2016
Messages
10
Hi all,

This is my first time posting here after having read a lot of threads, but i'm currently facing something i cannot seem to solve.
My situation is as follows:

In one worksheet (A) of my Excel file I have a list of entries divided over four columns (A,B,C,D) and 8000 rows. these are delivery statements (one Year) and contain both a unique supplier code (Column A) as well as a date of delivery (Column C).
In another sheet (B) I have a list of roughly 55 automatically generated suppliers with thier unique supplier code in Column A.

What I need to do now is to find out how many deliverys a certain supplier has made in the given period. This does not seem like a big issue since we could just use the COUNTA function to count the times a certain supplier code appears in the delivery statements. This is however the part where it becomes tricky. One Delivery of a certain supplier could consist out of multiple order numbers and thus creating mulitple entries in the automated system, thus giving a to high number when using the COUNTA function.

The deliveries need to be narrowed down according to the dates that are behind them. thus counting the amount a certain supplier code appears in the list but only counting it once per date

To give an example:

Supplier A could be in the system as having 4 deliveries on 3-6-2015 and 3 deliveries on 6-9-2015. COUNTA would see this as 7 deliveries total but i need excel to see it as 2.

What i did is created a new tab (C) where each supplier code generated in tab (B) would show up at the top of a new column and then having 8000 times the following formula below it:

=IFERROR(IF(COUNTIF($A$2:$A3;IF($A$2=Inkoopontvangsten!A4;Inkoopontvangsten!C4;""))=1;"";IF('Berekening Inkoopontvangsten'!$A$2=Inkoopontvangsten!A4;Inkoopontvangsten!C4;""));"")

(The formula was originally written in Dutch but i changed the functions to English for better understanding.)

this resulted in the correct information filtering out the deliveries of a certain supplier based on the supplier code in Row 1 of this worksheet, comparing it to the supplier codes in Column A in worksheet (A) and showing me the date. then for the next cell it would not show me the date and leave it blank if the date was allready mentioned. This was then copied down causing this part COUNTIF($A$2:$A3 to change with it.

next i would use the COUNT function to see how many cells in a certain column would contain the dates and this gave me the amount of deliveries a certain supplier made in a given period.

This method however, creates 60 columns of 8000 rows with the formula, causing excel to either take a long time calculating the results or hang completely.

My question is, is there any way the information i need can be extracted from the data in Sheet A without having to put in this many formulas.

Kind regards,
Bjard
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Mr Aladin Akyurek i've tried to show what you asked for.

This is the First Worksheet which contains the deliveries:


Nr.Leveranciersnaam
Datum
Ordernr.
R00000315 6-1-2015
IOR1406131
R00006753 6-1-2015 IOR1403092
R00000510 6-1-2015 IOR1406181
R00000482 7-1-2015 IOR1406129
R00000510 7-1-2015 IOR1405971
R00000510 7-1-2015 IOR1406008
R00000510 7-1-2015 IOR1406076
R00000510 7-1-2015 IOR1406077
R00000510 7-1-2015 IOR1406078
R00000510 7-1-2015 IOR1405896
R00000510 7-1-2015 IOR1406099
R00005535 7-1-2015 IOR1405404
R00000877 7-1-2015 IOR1406115

<colgroup><col><col><col><col></colgroup><tbody>
</tbody>


As you can see, on 7-1-2015 there were 7 entries of NR R00000510 but i want it to count only 1
These deliveries need to be sorted based on the Nr. Column. which would give the following result


R000005102
6-1-2015
7-1-2015

<colgroup><col style="width:48pt" width="64"> <col style="width:48pt" width="64"> </colgroup><tbody>
</tbody>


the number next to the NR. column is the amount of deliveries and the dates below are generated based the number at the top


Is this what you mean?
 
Upvote 0
PS. Below the 7-1-2015 would then be multiple empty rows where the 7-1-2015 is not displayed
 
Upvote 0
Pps. i dont need the dates, these are just a step in between to be able to count the deliveries.

(im sorry for the multiple posts)
 
Upvote 0
SUPPLIERDATE
A01/04/2016
A01/04/2016
B01/04/2016
B01/04/2016
B01/04/2016
B01/04/2016
C01/04/2016
C02/04/2016
C02/04/2016
C02/04/2016
C02/04/2016
B02/04/2016
B02/04/2016
C02/04/2016
B02/04/2016
B02/04/2016
C02/04/2016
A03/04/2016
B03/04/2016
C03/04/2016
A03/04/2016
A03/04/2016
A03/04/2016
B04/04/2016using sumproduct the top table is deliveries per day
B04/04/2016
B04/04/2016
C04/04/2016
C04/04/2016
C04/04/2016ABC
01/04/2016241
02/04/2016046
03/04/2016411
04/04/2016033
ABC
01/04/2016111
02/04/2016011
03/04/2016111
04/04/2016011
the lower table merely converts numbers greater than 1 to 1

<colgroup><col><col><col span="3"><col><col span="6"></colgroup><tbody>
</tbody>
 
Upvote 0
Row\Col
A​
C​
D​
F​
1​
Nr.DatumOrdernr.R00000510
2​
R00000315
6/1/2015
IOR1406131count
3​
R00006753
6/1/2015
IOR1403092
2
4​
R00000510
6/1/2015
IOR1406181date list
5​
R00000482
7/1/2015
IOR1406129
6/1/2015
6​
R00000510
7/1/2015
IOR1405971
7/1/2015
7​
R00000510
7/1/2015
IOR1406008
8​
R00000510
7/1/2015
IOR1406076
9​
R00000510
7/1/2015
IOR1406077
10​
R00000510
7/1/2015
IOR1406078
11​
R00000510
7/1/2015
IOR1405896
12​
R00000510
7/1/2015
IOR1406099
13​
R00005535
7/1/2015
IOR1405404
14​
R00000877
7/1/2015
IOR1406115

In F2 control+shift+enter, not just enter:
Rich (BB code):
=SUM(IF(FREQUENCY(IF($A$2:$A$14=F$1,$C$2:$C$14),$C$2:$C$14),1))

In F5 control+shift+enter and copy down:
Rich (BB code):
=IF(ROWS($F$5:F5)<=$F$3,MIN(IF($A$2:$A$14=$F$1,IF(ISNA(MATCH($C$2:$C$14,$F$4:F4,0)),
    $C$2:$C$14))),"")
 
Upvote 0
i'm still learning and I had no idea that something that seemed so cumbersome to me could be solved by one single formula.
My hat off to you sir.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

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