Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 90
Default COUNTIF and VLOOKUP

Hey,

I'm trying to set up the following. I have a list of about 100 numbers in
ColA and I want to be able to count how many times each number is followed by
a specific number.

My 100 numbers are all between 0 and 30. So if the list was something like:

14
0
12
12
4
30
0
12

I'd want my table to say that 14 was followed by 0 once, 0 was followed by
12 twice, 12 was followed by 12 once and 4 once, 4 was followed by 30 once,
30 was followed by 0 once. My table would be 31x31.

0-1-2-3-4-5-6-etc...
1
2
3
4
5
6
etc...

I figured a countif might do it, but I'm not sure how to incorperate the
entire 100 numbers.

Thanks,
Matt
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default COUNTIF and VLOOKUP

Try this:

Numbers in A1:A8

Matrix table column headers in D1:x1, row headers in C2:Cx

Enter this formula in D2:

=SUMPRODUCT(--($A$1:$A$7=D$1),--($A$2:$A$8=$C2))

Note how the references to column A are offset.

Copy across then down as needed.


--
Biff
Microsoft Excel MVP


"mpenkala" wrote in message
...
Hey,

I'm trying to set up the following. I have a list of about 100 numbers in
ColA and I want to be able to count how many times each number is followed
by
a specific number.

My 100 numbers are all between 0 and 30. So if the list was something
like:

14
0
12
12
4
30
0
12

I'd want my table to say that 14 was followed by 0 once, 0 was followed by
12 twice, 12 was followed by 12 once and 4 once, 4 was followed by 30
once,
30 was followed by 0 once. My table would be 31x31.

0-1-2-3-4-5-6-etc...
1
2
3
4
5
6
etc...

I figured a countif might do it, but I'm not sure how to incorperate the
entire 100 numbers.

Thanks,
Matt



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 90
Default COUNTIF and VLOOKUP

Perfect - Thanks alot!

Matt

"T. Valko" wrote:

Try this:

Numbers in A1:A8

Matrix table column headers in D1:x1, row headers in C2:Cx

Enter this formula in D2:

=SUMPRODUCT(--($A$1:$A$7=D$1),--($A$2:$A$8=$C2))

Note how the references to column A are offset.

Copy across then down as needed.


--
Biff
Microsoft Excel MVP


"mpenkala" wrote in message
...
Hey,

I'm trying to set up the following. I have a list of about 100 numbers in
ColA and I want to be able to count how many times each number is followed
by
a specific number.

My 100 numbers are all between 0 and 30. So if the list was something
like:

14
0
12
12
4
30
0
12

I'd want my table to say that 14 was followed by 0 once, 0 was followed by
12 twice, 12 was followed by 12 once and 4 once, 4 was followed by 30
once,
30 was followed by 0 once. My table would be 31x31.

0-1-2-3-4-5-6-etc...
1
2
3
4
5
6
etc...

I figured a countif might do it, but I'm not sure how to incorperate the
entire 100 numbers.

Thanks,
Matt




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default COUNTIF and VLOOKUP

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"mpenkala" wrote in message
...
Perfect - Thanks alot!

Matt

"T. Valko" wrote:

Try this:

Numbers in A1:A8

Matrix table column headers in D1:x1, row headers in C2:Cx

Enter this formula in D2:

=SUMPRODUCT(--($A$1:$A$7=D$1),--($A$2:$A$8=$C2))

Note how the references to column A are offset.

Copy across then down as needed.


--
Biff
Microsoft Excel MVP


"mpenkala" wrote in message
...
Hey,

I'm trying to set up the following. I have a list of about 100 numbers
in
ColA and I want to be able to count how many times each number is
followed
by
a specific number.

My 100 numbers are all between 0 and 30. So if the list was something
like:

14
0
12
12
4
30
0
12

I'd want my table to say that 14 was followed by 0 once, 0 was followed
by
12 twice, 12 was followed by 12 once and 4 once, 4 was followed by 30
once,
30 was followed by 0 once. My table would be 31x31.

0-1-2-3-4-5-6-etc...
1
2
3
4
5
6
etc...

I figured a countif might do it, but I'm not sure how to incorperate
the
entire 100 numbers.

Thanks,
Matt






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
countif w/vlookup sjl Excel Discussion (Misc queries) 2 February 16th 07 03:05 PM
vlookup and countif??? Joe Excel Worksheet Functions 5 March 13th 06 10:33 AM
Countif or Vlookup praveen_khm Excel Worksheet Functions 1 February 3rd 06 08:17 PM
Countif? or Vlookup? Lost?? leo Excel Worksheet Functions 3 November 30th 05 02:17 PM
vlookup, sumif, if, countif, help chintu49 Excel Worksheet Functions 0 May 26th 05 03:00 PM


All times are GMT +1. The time now is 05:01 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"