Forum Discussion
Izzy0803
May 25, 2022Copper Contributor
Greater than and less than functions
I need a cell (J4) to calculate a range of cells (E4:E73) and show the result in cell (J4). If the individual cells are greater than 1.5 it needs to add the value of leftover amount, also if the ind...
- May 25, 2022so did you try =SUM( range ) - COUNT( range)*1.5
or if you are really just interested in the Average then why not:
=AVERAGE( range )
or the difference from the target average:
= AVERAGE( range ) - 1.5
mtarler
May 25, 2022Silver Contributor
I am wondering if the cell is < 1.5 is it supposed to subtract 1.5 from the calculation OR subtract 1.5 from the cell value and add the difference to the calculation? If it is the latter as is what the above solution appears to give then can't you just do:
=SUM( range ) - COUNT( range)*1.5
which by the way will ignore spaces.
If it is the former then you need something like:
=SUMPRODUCT( ISNUMBER(range)*( (range>1.5)*(range - 1.5) - (range<1.5)*1.5))
BTW what should happen if the value is exactly 1.5?
=SUM( range ) - COUNT( range)*1.5
which by the way will ignore spaces.
If it is the former then you need something like:
=SUMPRODUCT( ISNUMBER(range)*( (range>1.5)*(range - 1.5) - (range<1.5)*1.5))
BTW what should happen if the value is exactly 1.5?
Izzy0803
May 25, 2022Copper Contributor
It is to subtract from the cell value and if it is 1.5 it can be ignored too. I am calculating "bank time" for our pilots. They must fly 1.5 on average for each period they fly. So if they fly 1.3 it would be -0.2. Also if they flew 2.4 it would add 0.9
- mtarlerMay 25, 2022Silver Contributorso did you try =SUM( range ) - COUNT( range)*1.5
or if you are really just interested in the Average then why not:
=AVERAGE( range )
or the difference from the target average:
= AVERAGE( range ) - 1.5- Izzy0803May 25, 2022Copper Contributor=SUM( range ) - COUNT( range)*1.5
WORKS!
I really appreciate the help and knowledge