Display result depending on value entered

G

Gotroots

I want a quick way to enter a time in a cell.

example:

F5 can either be 00:45 or 00:30

If the value 1 is entered into G5 then F5 will return 00:45
and if the value 2 is entered into G5 then F5 will return 00:30

what formula do I need for F5

Thank you, your help is appreciated.
 
L

Lars-Ã…ke Aspelin

Gotroots said:
I want a quick way to enter a time in a cell.

example:

F5 can either be 00:45 or 00:30

If the value 1 is entered into G5 then F5 will return 00:45
and if the value 2 is entered into G5 then F5 will return 00:30

what formula do I need for F5

Thank you, your help is appreciated.

Try this formula in cell F5:

=CHOOSE(G5,"00:45","00:30")

Hope this helps / Lars-Ã…ke
 
J

Jacob Skaria

Try the below formula and format the cell to time format

=IF(G5=1,45/1440,IF(G5=2,30/1440,""))
OR
=IF(G5=1,TIMEVALUE("00:45"),IF(G5=2,TIMEVALUE("00:30"),""))
OR
=IF(G5=1,TIME(0,45,0),IF(G5=2,TIME(0,30,0),""))
 
T

trip_to_tokyo

I have just put a file up for you at:-

http://www.pierrefondes.com/

Item number 29 towards the top of the page (at the top at the moment) where
you can see your example working successfully.

Take a look at Sheet1.

I have done things slightly differently from Jacob.

Done in EXCEL 2007.

Please hit Yes if my comments have helped.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top