IF function with Time duration [Closed]

- - Latest reply: ac3mark
Posts
13034
Registration date
Monday June 3, 2013
Status
Moderator
Last seen
October 11, 2019
- Jan 28, 2016 at 04:33 PM
Hello,
I dont understanding why this can't work :

=IF((g2=timevalue("0:30"));"25)

G2 has a time duration time unit in it which equals 0:30. I am trying to show that if something lasted 30 minutes I need another cell to say that it will cost 25

Thank you


See more 

2 replies

Posts
13034
Registration date
Monday June 3, 2013
Status
Moderator
Last seen
October 11, 2019
1535
0
Thank you
Your syntax is wrong in multiple areas. There is a comma delimiter, not a colon, and you have no end quotes.

Try this:
=IF((g2=timevalue("0:30")),"25","BLANK")

that syntax is correct.
wow, thank you!!!! it worked

Except for some of the cells that are equal 0:30 it still shows as blank, but for most it doesnt.

How would I also add other parameters. Say: if f2=saturday, g2=0:30 then 35 . if f2=monday, g2=0:30 then 25
Posts
13034
Registration date
Monday June 3, 2013
Status
Moderator
Last seen
October 11, 2019
1535
0
Thank you
It is possible to nest if statements. It can get messy. I am certain there is a cleaner way, I just never had to expand beyond two or three choices.

The nested if looks like this:
=if(logic_test,if(logic_test#2,true,false),false)

I hope this helps. If you are satisfied, mark it as solved! Thanks and HAVE FUN!