Sumproduct ?

Tikey

Board Regular
Joined
Jan 30, 2014
Messages
148
Office Version
  1. 2021
Platform
  1. Windows
Hi

I have a column of dates which cover several years in the format 01/01/2018, this column is modified with dates added to and removed regularly. I wish to be able to search for a particular year and then sum all the dates in that year without counting the same date twice.

I have been trying SUMPRODUCT without any success, can anyone offer any guidance please.

Thanks.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Hi,

Your explanation is not totally clear ... :wink:

Do you actually to sum 'dates' or some amounts for these dates ....?

Why don't you post your sumproduct formula ... it could be a simple issue to fix ...
 
Upvote 0
Sorry about that, I wish to sum the number of these dates eg

01/01/2018
01/01/2018
02/01/2018
02/01/2018

The answer would be 2. I haven't included my attempt as it appeared to have too many errors.
 
Upvote 0
Hello again,

So ... your objective is to Count the Unique dates ... :wink:

Say all your dates are located in cells A1 to A100 ... you could have your total count in cell C1 with following formula:

Code:
[FONT=arial]=SUMPRODUCT(1/[/FONT]COUNTIF(A1:A100,A1:A100))

Hope this will help
 
Upvote 0
Thanks for your reply.

Whilst I'm sure your suggestion will count the unique dates, I don't believe it will deal with the other requirements. It needs to be able to search through the column of dates for those dates which are in a specified year and then count the dates, the number of dates within the column also changes regularly and therefore I am assuming the cell range cannot be specified but will need to use a full column address ie A:A
 
Upvote 0
Re,

If you need to restrict the year ... you could test the following array formula :

Code:
=SUM(--(FREQUENCY(IF(Year(A1:A100)=2018,A1:A100),A1:A100)>0))

You have to use simultaneously the 3 keys : Control Shift Enter ... instead of the standard Enter key ...

HTH
 
Upvote 0
Thank you.

That works fine with the range of cells, when I modify that to a full column it still works fine, but if I modify it to a full column on another sheet I get a #VALUE ! error.
 
Upvote 0
Glad you are getting closer ... to your solution ...

The danger of a ' full column ' ... is that you might have text such as headers which will disrupt the formula ...
 
Upvote 0
Hi

I've had a further play with this and it works ok on a range of cells on another sheet, but not the full column, could the fact that I have a header to the column be causing the problem ?
 
Upvote 0
Hi

I've had a further play with this and it works ok on a range of cells on another sheet, but not the full column, could the fact that I have a header to the column be causing the problem ?

Yes ...

Did you read my message # 8 ...? :wink:
 
Upvote 0

Forum statistics

Threads
1,215,166
Messages
6,123,395
Members
449,098
Latest member
ArturS75

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