All,
I am new to UDFs and need to create one for the following formula:
=IF(COUNTIF($D2:D$20000,D2)=1,(COUNTIF(D:D,D2)/COUNTIF(D:D,D2)),"0")
Any help would be greatly appreciated.
All,
I am new to UDFs and need to create one for the following formula:
=IF(COUNTIF($D2:D$20000,D2)=1,(COUNTIF(D:D,D2)/COUNTIF(D:D,D2)),"0")
Any help would be greatly appreciated.
will return a value of 1, and "0" is a text string, not the value 0.Formula:Please Login or Register to view this content.
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
I understand that and it is the intended outcome. Background: I have a unique identifier which I need tagged for unique instances; my formula does that by tagging 1 or 0 (do not need value). Because my data set is growing, and the amount of unique IDs created is increasing, I need to create a UDF which will help me shorten having to write out the formula. So essentially i just want to be able to input "=uniqueinstance(d2:d20000)" or something along those lines.
What about this bit:The first $D2 does not have the row fixed. Is that intentional? Is D2000 meant to be fixed or do you want the UDF to determine the last row?Formula:Please Login or Register to view this content.
It is indeed intentional and ideally I would like the UDF to determine the last row; 20000 is just a placeholder at this point but the data set will exceed that in a few months time.
I think a UDF is overkill given thatis redundantFormula:Please Login or Register to view this content.
You can just use this:Formula:Please Login or Register to view this content.
And, if you create a Dynamic Named Range, for example, Col_D, defined as:Formula:Please Login or Register to view this content.
You can then have:Formula:Please Login or Register to view this content.
Note that, when you create the DNR, you MUST be on row 2 because the row, as in $D2, will reflect the current row
That seems pretty short to me, and much more convenient than having to make your workbook macro enabled just so you can have a UDF.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks