I
I
izmail19972020-10-30 10:00:59
excel
izmail1997, 2020-10-30 10:00:59

How to correctly write a function in an EXCEL cell so that a certain row of a sequence of numbers appears?

What function should I enter in the EXCEL cell so that by dragging the cell and with this function I get numbers (a series of numbers) 333333322222222111111111 (each digit is in a separate cell). No matter how far I pull, it is important that there are 33% of digits 3, 33% of digits 2, 33% of digits 1. USE ONLY FUNCTIONS., You cannot use global excel settings.5f9bb981daece529863666.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
ComodoHacker, 2020-10-31
@izmail1997

In fact, we need to find out the size of the entire range and the place of the current cell in it. The main problem is to avoid circular references.
For example, using COUNTA() you can determine how many cells are filled on the left. Or right. But it’s impossible to use both in one formula, because there are circular references.
The position of the current cell can also be determined using COLUMN() and subtract the fixed offset. This is a small hack, maybe better.
What follows is simple arithmetic. We get the distribution in the range 0-1, multiply by 3, round.
For example, for the starting cell C4:

=CEILING((COUNTA(D4:$XFD4) + 1) / (COUNTA(D4:$XFD4) + COLUMN() - 2) * 3; 1)

For a different initial cell, you need to correct the constant in "COLUMN () - 2".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question