Just to wrap this up...
the UDF can be used with Merged Areas & Non-Merged Areas, Names and non-Names, Contiguous and non-Contiguous ranges...
(obviously use with unnamed contiguous ranges would be a little pointless...)
it should return the count of unique rows / columns contained within the specified range.
Examples:
=RCX(zaza,0)
--> returns unique rows as used in named range (will use Merge address if exists)
=RCX(zaza,1)
--> as above but returns unique columns
=RCX((A1:A10,B1:B14,C2:F3,E12:G12,J2),0)
--> will return 14 given there are 14 unique rows
=RCX((A1:A10,B1:B14,C2:F3,E12:G12,J2),1)
--> will return 8 as there are 8 unique columns [A:G,J]
Note that if any of the above ranges were themselves part of a merged area the merge area range would supercede, eg: J2 was merged as J2:L2 then:
=RCX((A1:A10,B1:B14,C2:F3,E12:G12,J2),1)
--> will return 10 as there are 10 unique columns [A:G,J:L] - K & L are included given J2 is merged with those columns.
obviously you could add a further toggle re: unique/non-unique if so desired.
Bookmarks