I need a simple code to resolve the following

rufuxinix

New Member
Joined
Jan 23, 2019
Messages
39
Office Version
  1. 2019
Platform
  1. Windows
Good morning

This should be easily done if not in Excel tehn in VBA

I need a simple code to resolve the following

I have a table with cells filled with numbers, or words, and cells which are empty, randomly.

I want to automatically depict next to each row the following example. row as 121, where the contents of that row would be

Example:

The contents of the row would be as below and the result would show, on a cell net to the row, 121

Filled cell / Empty cell /Filled Cell / Filled cell / empty cell / Filled cell = 121

Note: empty cells can be consecutively more than one and the result would still be 121, such as below

Filled cell / Empty cell /Filled Cell / Filled cell / empty cell / empty cell / Filled cell = 121

Some other examples

Filled cell / Filled Cell / Filled cell / empty cell / empty cell / Filled cell = 31
Filled cell /Filled Cell / Filled cell
/ empty cell / empty cell / empty cell = 3
empty cell / empty cell / Filled cell /Filled Cell / Filled cell = 3


Hope someone can help.

Thank you for your attention

Regards
 
I don't think it will be possible with formulas without a helper column
Book2
ABCDEFGHIJKL
1Original formulaHelperResult
24681114683
32681112683
413456781613456781
5578125782
63571113573
73571113573
812782212783
9256122562
1034672234673
115151
1212672212673
1314561314561
Sheet6
Cell Formulas
RangeFormula
J2:J13J2=CONCAT(IFERROR(1/(1/FREQUENCY(IF($A2:$H2<>"",COLUMN($A2:$H2)),IF($A2:$H2="",COLUMN($A$2:$H$2)))),""))
K2:K13K2=VALUE(CONCAT(A2:H2))
L2:L13L2=SUM(IF(FREQUENCY(IF($J$2:$J$13=$J2,$K$2:$K$13),$K$2:$K$13)>0,1))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Thanks Jason, but i'm not getting it.
You say it might not be possible to calculate, without a helper column.
With the helper column the Result column is not showing the correct answer.
Am i missing something?
Thanks for trying.
 
Upvote 0
I thought that you wanted the count of different 111 combinations in the list, in the table there are 4 rows with 111, but only 3 are different (unique) the last one is a duplicate.
Is that not correct?
 
Upvote 0
No, what I want to know is, in a roster as above, how many variations can i have that will meet the condition for 111, or 121, or whatever.
So with 8 fields, for 111 on my example above, there will be 16 variations: 135, 136, 137, 138, 146, 147, 148, 157, 158, 246, 247, 248, 257, 258, 357, 358.
For, all the other possibilities, like 212, 12, 22, whatever it is, there would be many other variations.
To work all this out by hand is too laborious.
Thanks for the interest and help!
 
Upvote 0
For, all the other possibilities, like 212, 12, 22, whatever it is, there would be many other variations.
I see what you mean now, I'll give it some thought but I'm not sure that what you want will be possible without a reference list of the known combinations.
 
Upvote 0

Forum statistics

Threads
1,215,183
Messages
6,123,529
Members
449,105
Latest member
syed902

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top