Scenario:
To get Total hours worked in a day in relation to Normal working hours with the following requirements.

  • If Total Hours is greater than Hours per day, total hours should be reported in the form Number of days + number of hours.
  • If Total Hours is less than Hours per day, total hours should be reported in the form Number of hours.
  • If Total Hours is equal to Hours per day, total hours should be reported as  one day in reports.

Hours Per Day  =  Expected Hours of work from the user (Defined in the user profile)
Total Hours = Total hours worked in a day by the user.

Resolution:
Create a custom column in reports with the following code:

if (((TotalHours/HoursPerDay) * 100) >= 100, if (((TotalHours/HoursPerDay) * 100) = 100,(LEFT(NumberToText((TotalHours/HoursPerDay)),1) +" "+ "day"),LEFT((NumberToText(TotalHours/HoursPerDay)),1) + " " + "day" + " " + "and" + " " + LEFT((NumberToText((TextToNumber(RIGHT((NumberToText(TotalHours/HoursPerDay)),2))/100)*HoursPerDay)),1)+ " " + " " + "hrs"),(NumberToText(TotalHours) +" "+ "hrs"))