drom
Well-known Member
- Joined
- Mar 20, 2005
- Messages
- 543
- Office Version
- 2021
- 2019
- 2016
- 2013
- 2011
- 2010
- 2007
Hi and Thanks in advance!
I have a table with:
I know how to get the 1st, 2nd, 3rd, 4rd and 5th more frecuent values in this table using VBA
When this table is filtered by Column A, by country, and/or when is not filtered (Easy with VBA)
To get the more frecuent number I can use:
But I would like a formula:
I am attaching my WorkSheet:, this Worksheet is done just for this eg:
I have a table with:
- Max 9 columns ( for this eg: lets say 6 columns A:F)
- Unknown rows (for this eg: 23 rows)
- So My Table's databodyrange is A9:F30
- My Table's Header is A8:F8
- B9:F30 are cells with numbers, not blank cells, not text cells, numeric values, for this eg, I am using the formula, =RANDBETWEEN(1,100)
I know how to get the 1st, 2nd, 3rd, 4rd and 5th more frecuent values in this table using VBA
When this table is filtered by Column A, by country, and/or when is not filtered (Easy with VBA)
To get the more frecuent number I can use:
- =Mode(B9:F30)
- =MODE(Table3[[VALUES1]:[VALUES5]])
But I would like a formula:
- To get the more frecuent number in my table when the table is filtered by column A
- To get the 2nd more frecuent number whenThe table is not filtered
- To get the 2nd more frecuent number when The table is filtered
I am attaching my WorkSheet:, this Worksheet is done just for this eg:
Book1 | |||||||||
---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | |||
1 | |||||||||
2 | This table can be filtered by Country | ||||||||
3 | |||||||||
4 | 1st More Frecuent Number: | ?? | |||||||
5 | 2nd More Frecuent Number: | ?? | |||||||
6 | 3rd More Frecuent Number: | ?? | |||||||
7 | |||||||||
8 | Country | VALUES1 | VALUES2 | VALUES3 | VALUES4 | VALUES5 | |||
9 | Spain | 77 | 61 | 75 | 24 | 59 | |||
10 | France | 96 | 18 | 60 | 13 | 97 | |||
11 | UK | 89 | 4 | 37 | 51 | 53 | |||
12 | USA | 98 | 42 | 21 | 9 | 94 | |||
13 | Spain | 18 | 61 | 70 | 47 | 72 | |||
14 | USA | 76 | 25 | 44 | 65 | 91 | |||
15 | Portugal | 69 | 38 | 44 | 21 | 22 | |||
16 | Italy | 97 | 43 | 7 | 85 | 3 | |||
17 | Belgium | 24 | 21 | 11 | 31 | 42 | |||
18 | Mexico | 79 | 44 | 26 | 33 | 48 | |||
19 | Mexico | 25 | 47 | 58 | 81 | 64 | |||
20 | uk | 27 | 71 | 45 | 4 | 12 | |||
21 | Italy | 74 | 54 | 35 | 17 | 73 | |||
22 | Usa | 76 | 60 | 60 | 42 | 77 | |||
23 | USA | 53 | 75 | 6 | 70 | 55 | |||
24 | UK | 96 | 51 | 88 | 11 | 52 | |||
25 | Italy | 58 | 64 | 32 | 39 | 64 | |||
26 | Spain | 59 | 25 | 21 | 62 | 48 | |||
27 | Spain | 79 | 40 | 34 | 13 | 47 | |||
28 | France | 47 | 84 | 85 | 37 | 17 | |||
29 | Portugal | 6 | 28 | 90 | 66 | 48 | |||
30 | France | 49 | 94 | 70 | 89 | 82 | |||
31 | |||||||||
Sheet2 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
B9:F30 | B9 | =RANDBETWEEN(1,100) |
Last edited: