# Countif using a changing date range and unique values

#### irampuria1

##### New Member
I am building a KPI dashboard using data pulled from external sources - one of the metrics I am trying to measure is "No. of Unique Invoices" (in essence the number of distinct & unique orders) received per week. We have a spreadsheet with the "Shipping Date" in Column A, "Product Name" in Column B and "Invoice No." in Column E, since multiple products may be bought under the same invoice number.

A B E
11/01 Product A 1
11/13 Product A 2
11/23 Product B 2
11/24 Product A 2
11/26 Product B 3
11/26 Product C 3

What I am trying to do is have the "Weekly No. of Unique Invoices" update automatically whenever the sheet is refreshed based on the "TODAY()" date. For the week of the 11/26, the Unique No. of Invoices per week would be "2." I need a formula that can (1) look up the date in column A to isolate the range as being between today() and today()-7, and (2) then count the number of distinct invoice numbers within that range of dates.

Sorry for the convoluted explanation, but this has been a tricky process to reconcile.

Thanks in advance for any help.

### Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi Irampuria,
something like this?
=COUNTIFS(A2:A13,"<="&TODAY(),A2:A13,">="&TODAY()-7)
Cheers,
Koen

Replies
1
Views
277
Replies
3
Views
244
Replies
3
Views
320
Replies
5
Views
723
Replies
1
Views
318

1,196,484
Messages
6,015,469
Members
441,898
Latest member
kofafa

### 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.

### Which adblocker are you using?

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

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