Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2
Default Counting unique values in a row

I am attempting to count the number of times a specific value range occurs in
a row throughout a large spreadsheet. For example, I have three values in
multipe rows:
A1=10, B1=20, C1=30,
A2=20, B2=10, C2=30.
A3=50, B3=50, C3=50
I want to create a formula that will allow me to count the number of rows
that contain 50,50,50 within a large area.
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 169
Default Counting unique values in a row

Here's an array formula that will help you count unique instances

SUM(1/COUNTIF(data_range,data_range))

CTRL+SHIFT+ENTER to activate the array
--
Tips for Excel, Word, PowerPoint and Other Applications
http://www.kan.org/tips


"BASCRUMMY" wrote:

I am attempting to count the number of times a specific value range occurs in
a row throughout a large spreadsheet. For example, I have three values in
multipe rows:
A1=10, B1=20, C1=30,
A2=20, B2=10, C2=30.
A3=50, B3=50, C3=50
I want to create a formula that will allow me to count the number of rows
that contain 50,50,50 within a large area.

  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2,420
Default Counting unique values in a row

=SUMPRODUCT(--(COUNTIF(OFFSET(A1,ROW(INDIRECT("1:"&lastrow))-1,0,1,3),50)=3))

--
__________________________________
HTH

Bob

"BASCRUMMY" wrote in message
...
I am attempting to count the number of times a specific value range occurs
in
a row throughout a large spreadsheet. For example, I have three values in
multipe rows:
A1=10, B1=20, C1=30,
A2=20, B2=10, C2=30.
A3=50, B3=50, C3=50
I want to create a formula that will allow me to count the number of rows
that contain 50,50,50 within a large area.



  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2
Default Counting unique values in a row

I think this is going to work, but I think I am caught up on what to put in
for lastrow. Also should I put my whole data range in where A1 is?

"Bob Phillips" wrote:

=SUMPRODUCT(--(COUNTIF(OFFSET(A1,ROW(INDIRECT("1:"&lastrow))-1,0,1,3),50)=3))

--
__________________________________
HTH

Bob

"BASCRUMMY" wrote in message
...
I am attempting to count the number of times a specific value range occurs
in
a row throughout a large spreadsheet. For example, I have three values in
multipe rows:
A1=10, B1=20, C1=30,
A2=20, B2=10, C2=30.
A3=50, B3=50, C3=50
I want to create a formula that will allow me to count the number of rows
that contain 50,50,50 within a large area.




  #5   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 15,768
Default Counting unique values in a row

I am caught up on what to put in for lastrow.

"lastrow" should be the count of total rows in your range. If your range of
data was from A1:C10 then lastrow = 10. However, you'd need to change the
syntax from:

ROW(INDIRECT("1:"&lastrow))

To:

ROW(INDIRECT("1:10"))

Probably easier if you replace lastrow with ROWS(rng), where rng is your
actual range. Like this:

ROW(INDIRECT("1:"&ROWS(A1:C10)))

Also should I put my whole data range in where A1 is?


No. Use whatever is the top left cell in your range. If your data is in the
range K19:M27 the top left cell in the range is K19 then you'd use K19.

This is why you should always tell use where your real data is located. It
seems most people use "fake" ranges when they post a question and in some
circumstances the location of the data can matter in how a formula is
crafted for the best result.


--
Biff
Microsoft Excel MVP


"BASCRUMMY" wrote in message
...
I think this is going to work, but I think I am caught up on what to put in
for lastrow. Also should I put my whole data range in where A1 is?

"Bob Phillips" wrote:

=SUMPRODUCT(--(COUNTIF(OFFSET(A1,ROW(INDIRECT("1:"&lastrow))-1,0,1,3),50)=3))

--
__________________________________
HTH

Bob

"BASCRUMMY" wrote in message
...
I am attempting to count the number of times a specific value range
occurs
in
a row throughout a large spreadsheet. For example, I have three values
in
multipe rows:
A1=10, B1=20, C1=30,
A2=20, B2=10, C2=30.
A3=50, B3=50, C3=50
I want to create a formula that will allow me to count the number of
rows
that contain 50,50,50 within a large area.








  #6   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 15,768
Default Counting unique values in a row

Here's another one:

=SUMPRODUCT(--(MMULT(--(A1:C100=50),{1;1;1})=3))

Note that using this the range is limited to no more that 5460 rows

--
Biff
Microsoft Excel MVP


"BASCRUMMY" wrote in message
...
I am attempting to count the number of times a specific value range occurs
in
a row throughout a large spreadsheet. For example, I have three values in
multipe rows:
A1=10, B1=20, C1=30,
A2=20, B2=10, C2=30.
A3=50, B3=50, C3=50
I want to create a formula that will allow me to count the number of rows
that contain 50,50,50 within a large area.



  #7   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 15,768
Default Counting unique values in a row

Sometimes we overlook the easiest solution!

=SUMPRODUCT(--(A1:A100=50),--(B1:B100=50),--(C1:C100=50))

--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
Here's another one:

=SUMPRODUCT(--(MMULT(--(A1:C100=50),{1;1;1})=3))

Note that using this the range is limited to no more that 5460 rows

--
Biff
Microsoft Excel MVP


"BASCRUMMY" wrote in message
...
I am attempting to count the number of times a specific value range occurs
in
a row throughout a large spreadsheet. For example, I have three values
in
multipe rows:
A1=10, B1=20, C1=30,
A2=20, B2=10, C2=30.
A3=50, B3=50, C3=50
I want to create a formula that will allow me to count the number of rows
that contain 50,50,50 within a large area.





  #8   Report Post  
Posted to microsoft.public.excel.newusers
DP DP is offline
external usenet poster
 
Posts: 58
Default Counting unique values in a row

If you have a minute -
Can you give a quick explanation of how this works? What does the " -- "
mean in a formula? I don't remember seeing it.
thanks for your time
dp

"T. Valko" wrote:

Sometimes we overlook the easiest solution!

=SUMPRODUCT(--(A1:A100=50),--(B1:B100=50),--(C1:C100=50))

--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
Here's another one:

=SUMPRODUCT(--(MMULT(--(A1:C100=50),{1;1;1})=3))

Note that using this the range is limited to no more that 5460 rows

--
Biff
Microsoft Excel MVP


"BASCRUMMY" wrote in message
...
I am attempting to count the number of times a specific value range occurs
in
a row throughout a large spreadsheet. For example, I have three values
in
multipe rows:
A1=10, B1=20, C1=30,
A2=20, B2=10, C2=30.
A3=50, B3=50, C3=50
I want to create a formula that will allow me to count the number of rows
that contain 50,50,50 within a large area.






  #9   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 15,768
Default Counting unique values in a row

See this:

http://xldynamic.com/source/xld.SUMPRODUCT.html

--
Biff
Microsoft Excel MVP


"dp" wrote in message
...
If you have a minute -
Can you give a quick explanation of how this works? What does the " -- "
mean in a formula? I don't remember seeing it.
thanks for your time
dp

"T. Valko" wrote:

Sometimes we overlook the easiest solution!

=SUMPRODUCT(--(A1:A100=50),--(B1:B100=50),--(C1:C100=50))

--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
Here's another one:

=SUMPRODUCT(--(MMULT(--(A1:C100=50),{1;1;1})=3))

Note that using this the range is limited to no more that 5460 rows

--
Biff
Microsoft Excel MVP


"BASCRUMMY" wrote in message
...
I am attempting to count the number of times a specific value range
occurs
in
a row throughout a large spreadsheet. For example, I have three
values
in
multipe rows:
A1=10, B1=20, C1=30,
A2=20, B2=10, C2=30.
A3=50, B3=50, C3=50
I want to create a formula that will allow me to count the number of
rows
that contain 50,50,50 within a large area.







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
Counting unique values doofus1981 Excel Discussion (Misc queries) 7 April 3rd 08 01:56 PM
Counting Unique Values Paul Ferro Excel Discussion (Misc queries) 1 April 11th 07 06:12 AM
counting the # of unique values bobby769 Excel Worksheet Functions 3 January 10th 07 04:08 AM
Counting unique values giantwolf Excel Discussion (Misc queries) 4 August 28th 06 01:31 PM
Counting unique values JK57 Excel Worksheet Functions 3 July 7th 06 01:02 AM


All times are GMT +1. The time now is 02:15 AM.

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"