K
K
KTG2021-12-06 23:01:46
excel
KTG, 2021-12-06 23:01:46

How to check if a cell is empty before calculating a cell?

I’ll make a reservation right away that I want to solve the problem using the Excel form mechanism, without macros, etc.
There is a table, in it, in the first column, the sums are written in rows (example: 1000, 2000). Then there are three columns, the heading indicates the name of the group of people and the number of people (5, 10, 15).
At the intersection of a row and a column, I want to calculate a proportional sum, depending on whether the group participated in the project or not.
For example, if all three people participated, then in the row, under the columns there will be a value according to the formula: sum / total number of people * people in the group.
So, if the cell is empty (without a formula), then the group did not participate and it is not taken into account.

I tried to check for an "empty" cell in a separate column and subtract the number of people in the group from the total number of people. But when you try to specify the result in the formula as "total number of people", Excel swears at the cyclicity of links.

Actually a question how it is fashionable to implement?

In words, the algorithm can be described in approximately the same way (it is not clear how to transfer it to Excel):
We are looking for all empty fields in the range of the table by row, we get the column indices. We consider the sum of the number of people not participating. In the "participant" formula, we substitute as the total number of people - the number of people not participating.

And is it possible to somehow sort through all the cells by columns in a row, so as not to prescribe with handles if there are 20 columns?

Sample table
S in the picture, where in orange are the values ​​\u200b\u200bthat I enter. Rows and columns can be added.
All other values ​​are calculated. Where it is highlighted in green - the proportional amount per group that took part in the project is calculated on the line. A sign of participation is the presence of a formula in the cell of the group column.61afb7e3b037c409126135.jpeg

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Daniil Babkin, 2021-12-09
@shtile

Formula for F3:

=SUMIFS($B$2:$D$2,$B3:$D3,"<>")

H
hint000, 2021-12-15
@hint000

Don't worry, just add participation flags.
61b975fb64f05591913313.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question