Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 79
Default Adding up with array formula

In A1:A9 a have some values that are either numbers, texts or blanks
In B1 I have =IF(COUNTIF($A$1:A1;A1)=1;1;0) which I copy down

This formula shows 1 when a value appears for the first time
0 when the value is blank or appears for
second, third... time

Finally, I add the range B1:B9 to count the number of different values
(not blank) that my range has.

My problem is:

I want to obtain the same sum with an array formula, without
intermediate results. No matter how hard I try, I am unable to get
get.

If possible, I'd like that the array formula resembles my original
formula =IF(COUNTIF($A$1:A1;A1)=1;1;0) .

Can anybody help?

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Adding up with array formula

So you're counting the number of unique entries in that range (a1:a9)?

=SUMPRODUCT((A1:A9<"")/COUNTIF(A1:A9,A1:A9&""))



vsoler wrote:

In A1:A9 a have some values that are either numbers, texts or blanks
In B1 I have =IF(COUNTIF($A$1:A1;A1)=1;1;0) which I copy down

This formula shows 1 when a value appears for the first time
0 when the value is blank or appears for
second, third... time

Finally, I add the range B1:B9 to count the number of different values
(not blank) that my range has.

My problem is:

I want to obtain the same sum with an array formula, without
intermediate results. No matter how hard I try, I am unable to get
get.

If possible, I'd like that the array formula resembles my original
formula =IF(COUNTIF($A$1:A1;A1)=1;1;0) .

Can anybody help?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Adding up with array formula

Try this:

=SUMPRODUCT((A1:A9<"")/COUNTIF(A1:A9,A1:A9&""))

Counts the uniques in the range.

Biff

"vsoler" wrote in message
oups.com...
In A1:A9 a have some values that are either numbers, texts or blanks
In B1 I have =IF(COUNTIF($A$1:A1;A1)=1;1;0) which I copy down

This formula shows 1 when a value appears for the first time
0 when the value is blank or appears for
second, third... time

Finally, I add the range B1:B9 to count the number of different values
(not blank) that my range has.

My problem is:

I want to obtain the same sum with an array formula, without
intermediate results. No matter how hard I try, I am unable to get
get.

If possible, I'd like that the array formula resembles my original
formula =IF(COUNTIF($A$1:A1;A1)=1;1;0) .

Can anybody help?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
array formula Tim Excel Worksheet Functions 4 February 13th 07 10:38 AM
meaning of : IF(Switch; Average(array A, array B); array A) DXAT Excel Worksheet Functions 1 October 24th 06 06:11 PM
adding cells within an array beecher Excel Worksheet Functions 11 August 30th 06 08:29 AM
Array Formula - using LEFT("text",4) in formula Andrew L via OfficeKB.com Excel Worksheet Functions 2 August 1st 05 02:36 PM
Adding rows to an array chris w Excel Worksheet Functions 1 December 10th 04 02:27 AM


All times are GMT +1. The time now is 09:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"