GOOGLE SHEETS: Counting Unique values based on another cells data.

j3sharp

New Member
Joined
Jul 7, 2022
Messages
6
Office Version
  1. 2013
Platform
  1. Windows
I keep a running total of how many orders need to be short shipped. I am able to use (=COUNTIFS(B:B,">=10/1/2022",B:B,"<=10/08/2022") to count the number of lines in a given time period as each line is required to be put in by itself. I would like to keep track of the MRs in the same way but an MR# can be added multiple time for different lines. How could I go about making a formula that would count the number of Unique MR#'s in column A based on a date range in Column B. I am not able to change the formatting of the sheet or add other lines as this is on Google sheets and is used by multiple people in the company.
Distressed MRs (3).xlsx
ABCDEFGHIJKLMNO
1 MRDate AddedLine #Distressed Part CodeQTYContainers (list all unless pooling)BUShort Shipped / RevisedMonthWeekOrder / LineOrdersShort Shipped / Revised%
2MR0222748110/3/2022216548 2N/ANTNEERevisedOctWeek 1Orders2520.00%
3MR0222820110/3/20221340799813VZC05116246NTMIKShort ShippedLines2051160.78%
4MR0222879610/3/20221MX06FIT2NTWABShort ShippedWeek 2Orders15580.00%
5MR0222846510/3/20222GPS-26NCM1VZC04043591 NTWABShort ShippedLines1206650.04%
6MR02228465 10/3/2022310915 1VZC04043591 NTWABShort ShippedWeek 3Orders#DIV/0!
7MR0222791610/3/20222U-31VZC04803628NTUNYRevisedLines0#DIV/0!
8MR0222791610/3/202221HFT410-3J1-302VZC04705188NTUNYRevisedWeek 4Orders#DIV/0!
9MR0219580810/3/202232SLS-B0EZEX1VZC05167293NTNYMRevisedLines0#DIV/0!
10MR0222839010/3/20221ESJ 2VZC05116330NTWABShort ShippedWeek 5Orders#DIV/0!
11MR0222754410/3/20227RCS-5 3VZC05035434NTWABRevisedLines0#DIV/0!
12MR0222842810/3/20225RCS-5 3VZC05035434NTWABRevisedTotalOrders#DIV/0!
13MR0222680510/3/202230NW-FMSE 3VZC05045610NTPWORevisedLines21#DIV/0!
14MR0222839710/3/202218491431VZC02810487NTPWOShort Shipped
15MR0222839710/3/202293002971VZC03037598 NTPWOShort Shipped
16MR0222839710/3/20221030021VZC00047201NTNYMShort Shipped
17MR0222809610/3/202215SMALL-C12VZC049866323NTUNYRevised
18MR0223027210/10/20226VRAN-V1NTPHIRevised
19MR0223081110/10/202210KRY10/21VZC05090280NTCARRevised
20MR0223014010/10/202238NW-F301VZ2poolingNTIPOShort Shipped
21MR0222932810/10/202227109181poolingNTIPOShort Shipped
22MR0223257210/11/2022233HE1AA1poolingNTUNYShort Shipped
Sheet2
Cell Formulas
RangeFormula
N3N3=COUNTIFS(B:B,">=10/1/2022",B:B,"<=10/08/2022")
N5N5=COUNTIFS(B:B,">=10/9/2022",B:B,"<=10/15/2022")
N7N7=COUNTIFS(B:B,">=10/16/2022",B:B,"<=10/22/2022")
G9G9=IFERROR(__xludf.DUMMYFUNCTION("if($A397="""","""",vlookup($A397,importrange(""https://docs.google.com/spreadsheets/d/1CarnJBaaenB9jArwN2pu_rgzCkDOnhZjGLmZfZVfZ8E/edit#gid=0&fvid=1831903662"",""Outbound Tracker!$A:$AA""),27,false))"),"NTNYM")
N9N9=COUNTIFS(B:B,">=10/23/2022",B:B,"<=10/29/2022")
N11N11=COUNTIFS(B:B,">=10/30/2022",B:B,"<=10/31/2022")
O2:O13O2=N2/M2
N13N13=N3+N5+N7+N9+N11
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:A22,C2:D22,F2:G22,E5:E22Expression=OR($W2="RESOLVED",$W2="CANCELLED")textNO
Cells with Data Validation
CellAllowCriteria
H1:H22List='Color Key'!$F$43:$F$44
 

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
are you still using version 2013 ???

=SUMPRODUCT(IF((B2:B8<=E2)*(B2:B8>=E1), 1/COUNTIFS(B2:B8, "<="&E2, B2:B8, ">="&E1, A2:A8, A2:A8), 0))

Count Unique based on dates.xlsx
ABCDE
1CodeStartdatestart8/24/22
2-------------------end8/26/22
3a12321-Aug-22
4b12425-Aug-22Unique Count
5b12425-Aug-223
6c12726-Aug-22
7c12824-Aug-22
8c12824-Aug-22
Sheet1
Cell Formulas
RangeFormula
E5E5=SUMPRODUCT(IF((B2:B8<=E2)*(B2:B8>=E1), 1/COUNTIFS(B2:B8, "<="&E2, B2:B8, ">="&E1, A2:A8, A2:A8), 0))
 
Upvote 0
are you still using version 2013 ???

=SUMPRODUCT(IF((B2:B8<=E2)*(B2:B8>=E1), 1/COUNTIFS(B2:B8, "<="&E2, B2:B8, ">="&E1, A2:A8, A2:A8), 0))

Count Unique based on dates.xlsx
ABCDE
1CodeStartdatestart8/24/22
2-------------------end8/26/22
3a12321-Aug-22
4b12425-Aug-22Unique Count
5b12425-Aug-223
6c12726-Aug-22
7c12824-Aug-22
8c12824-Aug-22
Sheet1
Cell Formulas
RangeFormula
E5E5=SUMPRODUCT(IF((B2:B8<=E2)*(B2:B8>=E1), 1/COUNTIFS(B2:B8, "<="&E2, B2:B8, ">="&E1, A2:A8, A2:A8), 0))
The work computer is using 2013, but the excell sheet is on google sheets
 
Upvote 0
What exactly do you mean by this?
Are you trying to do this in Excel, or in Google Sheets?
The sheet is hosted on Google Sheets as it is used company wide. I am responsible for updating this section of the document. I often download the sheet to make edits so I am not stepping on anybody else trying to do work and replace the data on the online sheet when done. Sorry if I was not clear on that.
 
Upvote 0
Note that while there is commonality between Excel and Google Sheets, they are NOT the same program and do have a number of differences. So not all Excel solutions will work in Google Sheets.

As such, you should post all Google Sheets questions to this forum General Discussion & Other Applications, as per the description of this forum:

1665664604851.png


Also please be sure to clearly mention in the thread title and/or question that you are trying to do this in Google Sheets. This way people who are trying to help you know exactly what program you are working with, and won’t provide answers that might not work for you.

I have moved this thread for you and updated your thread title.
 
Upvote 0
=SUMPRODUCT(IF((B2:B10000<=Z44)*(B2:B10000>=Y44), 1/COUNTIFS(B2:B10000, "<="&Z44, B2:B10000, ">="&Y44, A2:A10000, A2:A10000),0))
 
Upvote 0
Solution

Forum statistics

Threads
1,215,069
Messages
6,122,959
Members
449,096
Latest member
Anshu121

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