Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 186
Default Counting numbers in a series

Hi Everyone

I have a problem that's driving me crazy.

Say this is my data set

Row 1: 1 2 3 4
Row 2: 2 5 6 1
Row 3: 2 4 1 8
Row 4: 2 3 6 7

I want to find how many times the numbers 1 and 2 appear in each row. In
the dataset above, the answer would be 3 (i.e. rows 1, 2 and 3). In my real
dataset, I have 1090 rows. Anyone got any ideas???
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Counting numbers in a series

In cell E1 put this formula and copy down the column

=COUNTIF(A1:D1,1)

"Jack" wrote:

Hi Everyone

I have a problem that's driving me crazy.

Say this is my data set

Row 1: 1 2 3 4
Row 2: 2 5 6 1
Row 3: 2 4 1 8
Row 4: 2 3 6 7

I want to find how many times the numbers 1 and 2 appear in each row. In
the dataset above, the answer would be 3 (i.e. rows 1, 2 and 3). In my real
dataset, I have 1090 rows. Anyone got any ideas???

  #3   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Counting numbers in a series

Assuming your numbers data in A1:D1 down
In E1: =SUMPRODUCT(--ISNUMBER(MATCH({1,2},A1:D1,0)))
Copy E1 down as far as required. Returns 2 where the condition is satisfied.
Then in F1: =COUNTIF(E:E,2) will give the result that you seek
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:20,000 Files:362 Subscribers:62
xdemechanik
---
"Jack" wrote:
Say this is my data set
Row 1: 1 2 3 4
Row 2: 2 5 6 1
Row 3: 2 4 1 8
Row 4: 2 3 6 7

I want to find how many times the numbers 1 and 2 appear in each row. In
the dataset above, the answer would be 3 (i.e. rows 1, 2 and 3). In my real
dataset, I have 1090 rows. Anyone got any ideas???

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Counting numbers in a series

In my real dataset, I have 1090 rows.

This formula is limited to 5461 rows so you're well within that limit.

=SUMPRODUCT(--(MMULT(--(A1:D1090=1),{1;1;1;1})0),--(MMULT(--(A1:D1090=2),{1;1;1;1})0))

--
Biff
Microsoft Excel MVP


"Jack" wrote in message
...
Hi Everyone

I have a problem that's driving me crazy.

Say this is my data set

Row 1: 1 2 3 4
Row 2: 2 5 6 1
Row 3: 2 4 1 8
Row 4: 2 3 6 7

I want to find how many times the numbers 1 and 2 appear in each row. In
the dataset above, the answer would be 3 (i.e. rows 1, 2 and 3). In my
real
dataset, I have 1090 rows. Anyone got any ideas???



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
Can't sum a series of numbers Cathy Excel Discussion (Misc queries) 10 July 25th 08 02:49 PM
Part 2 - Counting series of text/number sequence andrew Excel Discussion (Misc queries) 3 July 22nd 08 03:52 AM
Counting a series of text and/or numbers within columns andrew Excel Discussion (Misc queries) 17 June 25th 08 09:49 AM
Series of numbers PA New Users to Excel 4 February 26th 06 12:20 PM
How to change a series of positive numbers to negative numbers Ellie Excel Worksheet Functions 5 September 5th 05 05:10 PM


All times are GMT +1. The time now is 08:48 AM.

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

About Us

"It's about Microsoft Excel"