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 ...
Riny_van_Eekelen
Nov 20, 2022Platinum Contributor
peterpeter1780 Don't follow the logic for the last row in your example, but it's probably a typo. Try this:
Though it seems to be a meaningless formula as the result will always be 37.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
- PeterBartholomew1Nov 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) ) - Riny_van_EekelenNov 20, 2022Platinum Contributor
peterpeter1780 Then I misunderstood. Forget about the MAX part then and just keep =MIN(A1:B1)
- PeterBartholomew1Nov 20, 2022Silver ContributorSorry for the overlap. I had put together a demo file and then got distracted by a discussion on solar panels before hitting 'Post'.
- Riny_van_EekelenNov 20, 2022Platinum Contributor
PeterBartholomew1 No problems!