# Help on a formula

edited 12/09/19

Hi there,

I try to convert hours to duration, on a basis : 7 hours = 1 day.

I made a formula that has been working so far. But my boss asked me to add a minute setting. So that's my formula :

= IF(AND(Heures@row = "0,5"); 0,05;

IF(AND(Heures@row = "1"); 0,1;

IF(AND(Heures@row = "1,5"); 0,2;

IF(AND(Heures@row = "2"); 0,3;

IF(AND(Heures@row = "2,5"); 0,35;

IF(AND(Heures@row = "3"); 0,4;

IF(AND(Heures@row = "3,5"); 0,5;

IF(AND(Heures@row = "4"); 0,6;

IF(AND(Heures@row = "4,5"); 0,65;

IF(AND(Heures@row = "5"); 0,7;

IF(AND(Heures@row = "5,5"); 0,8;

IF(AND(Heures@row = "6"); 0,9;

IF(AND(Heures@row = "6,5"); 0,95;

IF(AND(Heures@row = "7"); 1))))))))))))))

So it works for whole numbers, but nothing is dispolayed if I select a decimal number.

Have you an idea ?

Thanks a lot for your help.

• ✭✭✭✭✭✭

So you are wanting to figure out what percentage of 7 hours (for example) 3 hours and 52 minutes is?

• Hello thanks for comment.

I would like only to convert hours and half an hour.

So for instance if someone works : 2H30,

- I would have 2,5 in my column "hours"

- It would represent 0,3 in my column duration for one day.

I don't know if I'm clear

Thanks for help

• ✭✭✭✭✭✭

Ok. I am beginning to understand.

So 2H30 would equal 2,5 hours. 4H30 would equal 4,5 hours. So on and so forth.

How would 2 hours be displayed?

2H?

2H00?

2?

• 2 hours is displayed 2

My formula works when it returns a whole number. So it works with 2.

But nothing appears when it returns a decimal number. So it doesn't work with 2,5.

You can see it in my screenshots. Yet, I used the same exactly the same code.

• ✭✭✭✭✭✭

Have you tried removing the quotes from around the numbers?

• Great it works ! It was so simple in fact

Thank you so much for your help. Have a nice day.

• ✭✭✭✭✭✭