Forum Discussion
peterpeter1780
Nov 20, 2022Copper Contributor
excel formula help please
I need to get this formula to work to calculate the hours worked I am wanting the last column to read the lower of the previous 2 or 37.5 if the previous one is greater 1 51.50 ...
peterpeter1780
Nov 20, 2022Copper Contributor
I am trying to if b is 45.5 then it need to return 37.5 in row 2 its 31 so c needs to show 31 and not 37.5
PeterBartholomew1
Nov 20, 2022Silver Contributor
Sorry, but I have difficulty understanding what any of your number repressent or what you are trying to calculate. Also, it would be interesting to know what version of Excel you are using.
With anything after 2007, the data should probably be within a Table and simple formulas would be written to the Table. For example
StandardHrs
= MIN([@nominal],[@actual])
AdditionalHrs
= [@actual]-[@standard]With 365, the calculation becomes more demanding, but the result applies to the entire table and is dynamic
= LET(
standard, MAP(nominal, actual, LAMBDA(x,y, MIN(x,y))),
additional, actual - standard,
HSTACK(standard, additional)
)