Hello all,
I'm currently using the below formula and was wondering how to incorporate the offset function so it will work with an expanding data set.
=SUMPRODUCT(1/COUNTIF(A:A,A:A&""),A:A)
Thank you in advance.
Hello all,
I'm currently using the below formula and was wondering how to incorporate the offset function so it will work with an expanding data set.
=SUMPRODUCT(1/COUNTIF(A:A,A:A&""),A:A)
Thank you in advance.
From what I can see, this is summing unique numbers in column A, which can contain either text or numbers. It's probably VERY slow as it's calculating down more than 1,000,000 rows. Do you really need that number of rows? So, what do you mean by an "expanding dataset"? If you mean that today there are 20 rows of data and tomorrow, 30 and the nxt day 40, then create a named range.
here I created a Named range (called range) using the formiula:
=Sheet1!$A$2:INDEX(Sheet1!$A$2:$A$1000,COUNTA(Sheet1!$A$2:A$1000))
Your formula then becomes:
=SUMPRODUCT(1/COUNTIF(Range,Range&""),Range)
and only looks down column A as far as the last non-blank cell.
Glenn
None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.
Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh
Here's a more efficient method.
Create the dynamic range...
Name: Range (or whatever you want to call it)
Refers to: =$A$1:INDEX($A:$A,MATCH(1E100,$A:$A))
Then, the sum formula would be:
=SUM(IF(FREQUENCY(Range,Range),Range))
Biff
Microsoft MVP Excel
Keep It Simple Stupid
Let's Go Pens. We Want The Cup.
Thank you Glenn and Tony for your replies!
Feel a bit daft for not thinking of creating a dynamic range which I've used countless times before.
Best wishes
You're welcome. Thanks for the feedback!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks