I am making a formula excel
to subtract some cells depending on a logical value
=SI(Y(G11=DATOS!D2; B11="N2");C6-C11;0)
With this formula the value that I put in quantity is subtracted from the canvas number giving me the result, but this formula only works for that row, I am seeing how I can accommodate the formula so that it works for the rest of the rows and not only in row 11, I mean that if I put other data in row 12 and put a new amount, that amount is also subtracted with the canvas number and gives me the result in cell C7.
In the formula I am being very specific with the fields, for example saying B11="N2"
but I also need that B12="N2"
and so on with the cells down so that this formula works for the rest of the rows.
So that it takes an initial number and subtracts the sum of a column, as long as 2 other columns match conditions:
C6
- Initial number (Num Canvas)C7
- place where the formula goes, to show the resultC11:C99
- Column to subtract from the initial numberB11:B99
- Condition 1, this column has to beN2
G11:G99
- Condition 2, this column must be equal toDATOS!$D$2
(SUBCONTRATACION
in this example)Formula in C7 :
It will add all the values of the first parameter
$C$11:$C$99
, as long as the conditions of the rest match. In the formulaSUMAR.SI.CONJUNTO()
the first parameter is the range to add, and then come range, condition, range, condition,...etc.For more information, read about the SUMIF.SET function .
Example screenshot
8 - 4 - 1 = 3
(4
and1
they are the only ones that coincide with both conditions).after having seen your query, and that you tell me that if it works in the first one and then the rest fails, and also knowing that
C6
it does not vary, I think your failure would be in that part.So that it does not vary
C6
you have to anchor it, you do this once selected with the key F4, or in any case placing the dollar symbol$
before the column and row.This should help you.