Formula needed to track the number of times each customer picked up 4 or more parcels on the preferred pick up day within a given time frame

Help101

New Member
Hi Everyone,

We have a daily log of the number of parcels picked up by our customers. The number of parcels to be picked up ranges from 0 to a maximum of 5 per day.

Customers are each assigned a pick-up day (Column C) if they are picking up 4 or more parcels. Row 1 shows the date the parcels are picked up and Row 2 shows the week day corresponding to the pick-up dates.

Our challenge is that customers do not always follow their pick-up dates for 4 or more parcels. We would like to track (Column Z) and reward our customers who complied with their pick-up dates for 4 or more parcels from June 14th to June 16th (Column G to Column S).

We have more than 10 customers so counting manually is very challenging. I have reviewed online tutorials on this but it seems that the COUNTIFS function only works if the variables tracked are found in columns. Our records are in rows.

Thanks for the help.

Help101

 June 1 June 2 June 3 June 4 June 5 June 6 June 7 June 8 June 9 June 10 June 11 June 12 June 13 June 14 June 15 June 16 June 17 June 18 June 19 June 20 June 21 June 22 Customer Preferred Pick-up Day 7 1 2 3 4 5 6 7 1 2 3 4 5 6 7 1 2 3 4 5 6 7 Number of Time Customer Picked Up 4 or more Parcels on Preferred Pick-up Day 1 Customer 1 3 5 2 0 4 2 3 0 2 5 2 4 2 1 0 0 1 1 2 3 4 0 2 2 Customer 2 5 2 1 2 4 0 5 1 4 3 1 0 2 1 2 5 4 3 4 4 0 3 3 3 Customer 3 2 1 1 0 5 0 3 2 3 3 0 1 4 0 1 2 4 4 1 5 4 0 1 4 Customer 4 7 0 3 2 4 5 0 3 2 0 5 5 4 0 0 1 5 0 1 2 5 5 0 5 Customer 5 2 2 1 1 2 0 5 4 4 1 3 4 5 4 2 4 5 0 2 1 4 2 0 6 Customer 6 1 3 3 1 0 0 4 4 1 1 5 3 4 1 4 1 0 1 0 1 1 4 5 7 Customer 7 3 1 1 2 5 3 0 3 1 2 5 3 4 3 3 0 2 4 1 4 5 0 5 8 Customer 8 6 1 1 4 3 0 4 0 0 4 3 4 4 4 3 0 1 5 0 3 2 4 3 9 Customer 9 2 2 2 2 1 0 5 0 2 2 1 1 2 4 4 4 3 1 2 4 0 2 0 10 Customer 10 5 1 1 0 4 4 3 5 1 4 0 2 5 3 3 3 1 1 5 1 1 0 5

<tbody>
</tbody>

****** id="cke_pastebin" style="position: absolute; top: 660px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">
 1 0 5 0 3 2 3 3

<tbody>
</tbody>

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

RasGhul

Well-known Member
Hi Help,

Pls disregard post 2#

Hi,

You'll need to use the date formula to give you real June dates from 01-06-19, then you can format them as mmm-dd if you want Month / Day like your sample.

(Column G to Column S) Should mean 05-06-19 to 17-06-19 which is ok because you can change the Start & End date or the Parcel starting qty with the following;

Help101

New Member
=SUMPRODUCT((\$C\$1:\$X\$1>=\$Z\$1)*(\$C\$1:\$X\$1<=\$AA\$1)*(\$C\$2:\$X\$2=\$B3)*(\$C3:\$X3>=\$AB\$1))

Hi RasGhul,

Thanks very much. The formula above that you gave me works! On our spreadsheet, the dates are formatted properly so there were no issues.

Further questions would be the following.

1) How will the formula change if we add another lookup period. For example, instead of June 5-17 only, we also want info for both June 5-17 and June 19-22?
2) The above formula gives us the count for parcel pick-ups for 4-5 parcels. How will the formula change if we want info for pickups done on preferred dates for both 1 parcel and 3 parcels (added together)?

Thanks again.

Help101

Hi Help,

Pls disregard post 2#

Hi,

You'll need to use the date formula to give you real June dates from 01-06-19, then you can format them as mmm-dd if you want Month / Day like your sample.

(Column G to Column S) Should mean 05-06-19 to 17-06-19 which is ok because you can change the Start & End date or the Parcel starting qty with the following;

ABCDEXYZAAAB
101-06-1902-06-19Jun-03Jun-2205-06-1917-06-194
2CustomerPreferred7127
3Customer 1352021
4Customer 2521231
5Customer 3211011
6Customer 4703200
7Customer 5221100
8Customer 6133150
9Customer 7311250
10Customer 8611430
11Customer 9222200
12Customer 10511050

</tbody>
Sheet1

Worksheet Formulas
CellFormula
D1=C1+1
Z3=SUMPRODUCT((\$C\$1:\$X\$1>=\$Z\$1)*(\$C\$1:\$X\$1<=\$AA\$1)*(\$C\$2:\$X\$2=\$B3)*(\$C3:\$X3>=\$AB\$1))

</tbody>

<tbody>
</tbody>

RasGhul

Well-known Member
Ok the following, if I understand correctly;

Date range 5/06 - 17/06, on Preferred Day and Qty 1 & Qty 3 then
Date range 19/06 - 22/06, on Preferred Day and Qty 1 & Qty 3 added together.

Help101

New Member
Thanks RasGhul. I have not had the chance to use your new formula yet. I will test these on our data.

I would also like to share with you the formula below that I tried by myself but based on your example. This formula counts pick-up for both 1 and 3 parcels for June 5-17, 2019. So far, it works.

=SUMPRODUCT((\$C\$1:\$X\$1>=\$Y\$1)*(\$C\$1:\$X\$1<=\$Z\$1)*(\$C\$2:\$X\$2=\$B3)*((\$C3:\$X3=\$AA\$1-3)+(\$C3:\$X3=\$AA\$1-1))), where \$AA\$1=4 (from your older table). This formula is shorter.

=SUMPRODUCT((\$C\$1:\$X\$1>=\$Y\$1)*(\$C\$1:\$X\$1<=\$Z\$1)*(\$C\$2:\$X\$2=\$B3)*(\$C3:\$X3=\$AA\$1-3) + =SUMPRODUCT((\$C\$1:\$X\$1>=\$Y\$1)*(\$C\$1:\$X\$1<=\$Z\$1)*(\$C\$2:\$X\$2=\$B3)*(\$C3:\$X3=\$AA\$1-1). This formula is longer.

Regards,

Help101

Help101

New Member
Thanks very much RasGhul. Your formula worked!

Regards,

Help101

Ok the following, if I understand correctly;

Date range 5/06 - 17/06, on Preferred Day and Qty 1 & Qty 3 then
Date range 19/06 - 22/06, on Preferred Day and Qty 1 & Qty 3 added together.

11/06/201922/06/2019StartEndStartEndQty 1Qty 2
2CustomerPreferred775/06/201917/06/201919/06/201922/06/201913
3Customer 13520
4Customer 25231
5Customer 32110
6Customer 47001
7Customer 52201
8Customer 61351
9Customer 73151
10Customer 86131
11Customer 92202
12Customer 105153

</tbody>
Sheet1

Worksheet Formulas
CellFormula

</tbody>

<tbody>
</tbody>

RasGhul

Well-known Member
You're welcome thanks for feedback

1,102,782
Messages
5,488,852
Members
407,658
Latest member
Arias610

This Week's Hot Topics

• Timer in VBA - Stop, Start, Pause and Reset
[CODE=vba][/CODE] Option Explicit Dim CmdStop As Boolean Dim Paused As Boolean Dim Start Dim TimerValue As Date Dim pausedTime As Date Sub...
• how to updates multiple rows in muliselect listbox
Hello everyone. I need help with below code. code is only chaning 1st row in mulitiselect list box. i know issue with code...
• Delete Row from Table
I am trying to delete a row from a table using VBA using a named range to find what I need to delete. My Range is finding the right cell. In the...
• Assigning to a variable
I have a for each block where I want to assign the value in column 5 of the found row to the variable Serv. [CODE=vba] For Each ws In...
• Way to verify information
Hi All, I don't know what to call this formula, and therefore can't search. I have a spreadsheet with information I want to reference...
• Active Cell Address – Inactive Sheet
How to use VBA to get the cell address of the active cell in an inactive worksheet and then place that cell address in a location on the current...