Forum Discussion
Help with Formular to keep constants
So you need to use and not use the $ accordingly. The $ sign mean that part of the reference is absolute and should not change (when copied or filled) and without a $ means it is relative and should increment/change according to where the formula is copied to. So try:
=IF($B3="",0, IF(C$2="",0,(C$2+$B3)/2))
So basically this will 'lock' column B but not row 3 of $B3 and it will 'lock' row 2 but not column C of C$2
Alternatively you could also do this all using a single array formula:
=IF($B$3:$B$4="",0, IF($C$2:$G$2="",0,($C$2:$G$2+$B$3:$B$4)/2))
and since it is a single array formula there is no copy/fill needed so it really doesn't matter if you include the $ or not
2 other things of note or consideration are
a) you could consider using IFS or useing AND/OR functions instead of multiple IF. For example:
=IF(OR($B3="",C$2=""),0,(C$2+$B3)/2)
b) with array formula you could also multiply the 2 values and use that as a criteria (assuming 0% should also be ignored) for example:
in this case any cell that results in 0 due to the product is shown as blank ("") which includes both columns E (0%) an F (blank).