SOLUTION FOUND: INDEX + CORRESP
Thank you very much to the friends who tried to solve my problem, but I managed to unravel, after a lot of breaking my head, since I had already tried to solve this same problem in other spreadsheets of mine and in more complicated tables than this, with several entries. The secret of the solution lies in the use of the function CORRESP, because with it, I can find in which line is the lowest value of steel area greater than calculated, simply using the TYPE OF CORRESPONDENCE -1(IS GREATER THAN), in the last argument of the formula. That way I use such value in the function INDEX, in which I have as matrix all my data, the line the value given by CORRESP and the column the value given by the cell linked to the Form Control, where the gauge is selected by the user, plus 1 unit
DETERMINATION OF THE EFFECTIVE STEEL AREA:
=SEERRO(ÍNDICE($N$5:$T$34;CORRESP(I21;SE(U12=1;$O$5:$O$34;SE(U12=2;$P$5:$P$34;SE(U12=3;$Q$5:$Q$34;SE(U12=4;$R$5:$R$34;SE(U12=5;$S$5:$S$34;SE(U12=6;$T$5:$T$34))))));-1);U12+1);"Selecione uma bitola de aço maior")
In function CORRESP of this formula, the user chooses a gauge, which corresponds to a number of the linked cell of the Form Control (Combobox - Not Control ACTIVEX). Thus, the 4.2mm gauge corresponds to index 1.5mm index 2 and so on. This will define the column in which the CORRESP will search. In general function INDEX, the last argument of the function that requests the column, where it contains the data that I want, is added a unit, because the user’s chosen gauge corresponds, in the table, to its index plus 1, that is, 4.2mm is index 1, but in the table is column 2, 5mm is index 2, but in the table is column 3 and so on (COLUMN=index+1).
The function SEERRO was used for the case of the largest slatted steel area of the selected gauge is lower than the calculated one, asking the user to choose a larger gauge.
The function CORRESP me, for the values highlighted below, the lines 9 and 13 of the table, respectively.
Of course that Table Auxiliary will not be viewed by the user, as well as the index of the gauge selection. I put for better understanding of what I did. I opted for the function INDEX at the beginning of PROCV because it allows me to search for data to the left and thus automatically determine the spacing of the bars (Column 1), which is another data that also interests me. Thus were used the same function above, with only modification of the last argument of the formula, which is now Table Column 1 (Spacing).
SPACING:
=SEERRO(ÍNDICE($N$5:$T$34;CORRESP(I21;SE(U12=1;$O$5:$O$34;SE(U12=2;$P$5:$P$34;SE(U12=3;$Q$5:$Q$34;SE(U12=4;$R$5:$R$34;SE(U12=5;$S$5:$S$34;SE(U12=6;$T$5:$T$34))))));-1);1);"─")
*OBS.: The formulas got big because I chose to put the formula CORRESP within the formula INDEX. But I could have done as I did initially, calculating the CORRESP in another cell and entering the function INDEX only with its numerical value.
What formula is currently used? And where do you choose the gauge? Any cells or in the formula?
– danieltakeshi
I am not using any formula at the moment. I am manually choosing through the table query. I choose the gauge by means of Combo Box (Form Control). This choice gives me a number in the link cell, which will correspond to the column in which I will look for the value.
– allanglayd
So you use VBA? code in the form? Edit the question with this information
– danieltakeshi
No. It’s not an Activex control. I don’t know how to work with VBA.
– allanglayd
As for the selected gauge there is no problem. What I want to solve is to find a function that compares the values of column S (say q the table has only one column, to simplify the understanding) with what I have, that is, that it compares from the lowest value (2,42) to the highest value (16,00)and return me the next higher than the calculated.
– allanglayd
I tried to use PROCV, with Approximate Matching (since I don’t have the exact value of 8.86 in the column in question), but it always returns me the lowest value of this column (2.42), which is obviously lower than what I have (8.86).
– allanglayd