Sajan
Excel Ninja
Challenge Name
-- Count the number of times a numeric 2-d array occurs in another 2-d array
Challenge Description
-- This is a formula challenge. As such, only formula submissions are accepted.
-- For two lists named "nList" and "sList", count the number of times "sList" appears in "nList".
-- To keep things simple, we will assume that both nList and sList have two columns each
-- Also, to simplify things, we will assume that sList has exactly two rows
-- Also, to simplify things, assume that sList will have at least one non-zero value
-- sList and nList may be located anywhere on a worksheet
-- nList has more rows than sList
-- nList and sList contain values that are not in any sequence
-- Goal is to calculate the count without using any helper cells.
We will remove some of these assumptions in a future challenge that tackles a more general case.
Sample data and output:
nList
[pre]
[/pre]
In this case, the output expected is 2 since sList occurs twice in nList.
Enjoy!
-Sajan.
-- Count the number of times a numeric 2-d array occurs in another 2-d array
Challenge Description
-- This is a formula challenge. As such, only formula submissions are accepted.
-- For two lists named "nList" and "sList", count the number of times "sList" appears in "nList".
-- To keep things simple, we will assume that both nList and sList have two columns each
-- Also, to simplify things, we will assume that sList has exactly two rows
-- Also, to simplify things, assume that sList will have at least one non-zero value
-- sList and nList may be located anywhere on a worksheet
-- nList has more rows than sList
-- nList and sList contain values that are not in any sequence
-- Goal is to calculate the count without using any helper cells.
We will remove some of these assumptions in a future challenge that tackles a more general case.
Sample data and output:
nList
[pre]
Code:
1 2
3 4
5 6
7 8
3 4
7 6
3 4
5 6
1 0
2 3
sList[/b]
3 4
5 6
In this case, the output expected is 2 since sList occurs twice in nList.
Enjoy!
-Sajan.