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
OliverScheurich
May 25, 2022Gold Contributor
=SUM(IF(E4:E74>1.5,E4:E74-1.5,E4:E74-1.5))
You can try this formula. Enter the formula with ctrl+shift+enter if you don't work with Office365 or 2021.
- Izzy0803May 25, 2022Copper ContributorThat works. The only problem I have now is I cant get it to ignore the blanks. If I enter " ", there are to many arguments for the function
- OliverScheurichMay 25, 2022Gold Contributor
=SUM(IF(NOT(ISBLANK(E4:E18)),IF(E4:E18>1.5,E4:E18-1.5,E4:E18-1.5)))
You can try this formula which seems to exclude blank cells in my sheet. Enter the formula with ctrl+shift+enter if you don't work with Office365 or 2021.
- mtarlerMay 25, 2022Silver ContributorI 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?- Izzy0803May 25, 2022Copper ContributorIt 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