Hi Pawal, My try,
=IF(ISERROR(FIND(".",A1,1)),TIME(LEFT(TEXT(SUBSTITUTE(A1,".",""),"0000"),2),RIGHT(TEXT(SUBSTITUTE(A1,".",""),"0000"),2),0),TIME(TEXT(INT(A1),"00"),(A1*100)-(INT(A1)*100),0)) I have tried with INT formula for decimal entries.... (For Decimal condition formula shown below) =TIME(TEXT(INT(A1),"00"),(A1*100)-(INT(A1)*100),0) Now it is working for all our conditions like, 532,1111,2.3,12.10....etc. I hope this is fulfill your requirements. Regards, MARIES. On Thu, Mar 29, 2012 at 6:14 PM, pawel lupinski <lupins...@yahoo.com> wrote: > hi Don, > > Yes, I've used data validation, and forcing people to do tis in right way. > But I need to sort past data and I'd like to learn from you all things that > I won't find in the books. > > Regards, > > Pawel > > PS macro I'm still not there. > > *From:* dguillett1 <dguille...@gmail.com> > *To:* excel-macros@googlegroups.com > *Sent:* Thursday, March 29, 2012 1:51 PM > > *Subject:* Re: $$Excel-Macros$$ format a cell > > BTW. You could use data validation to guide them to ONLY input as > desired. Or, an input box macro. > > Don Guillett > Microsoft MVP Excel > SalesAid Software > dguille...@gmail.com > > *From:* pawel lupinski <lupins...@yahoo.com> > *Sent:* Thursday, March 29, 2012 7:18 AM > *To:* excel-macros@googlegroups.com > *Subject:* Re: $$Excel-Macros$$ format a cell > > Maries, > > this is great, realy simplistic working fine, but what I find out today is > that people have tendency to input "2.3" what means "02:30" but formula > exchanging it to "00:23" can you help me on this? I've done something like > that: > > > =IF(ISERROR(LEN(A1)-FIND(".",A1,1)),TIME(LEFT(TEXT(SUBSTITUTE(A1,".",""),"0000"),2),RIGHT(TEXT(SUBSTITUTE(A1,".",""),"0000"),2),0),IF((LEN(A1)-FIND(".",A1,1))=1,TIME(LEFT(TEXT(SUBSTITUTE(A1&0,".",""),"0000"),2),RIGHT(TEXT(SUBSTITUTE(A1&0,".",""),"0000"),2),0),TIME(LEFT(TEXT(SUBSTITUTE(A1,".",""),"0000"),2),RIGHT(TEXT(SUBSTITUTE(A1,".",""),"0000"),2),0))) > > But if you can have a look and simplified it will be graet > > Regards, > > Pawel > > *From:* Maries <talk2mar...@gmail.com> > *To:* excel-macros@googlegroups.com > *Sent:* Thursday, March 29, 2012 8:36 AM > *Subject:* Re: $$Excel-Macros$$ format a cell > > Dear All, > > For these three conditions - 532, 1215 & 12.10, try below formula. > > > =TIME(LEFT(TEXT(SUBSTITUTE(A1,".",""),"0000"),2),RIGHT(TEXT(SUBSTITUTE(A1,".",""),"0000"),2),0) > > Regards, > > MARIES. > > On Thu, Mar 29, 2012 at 10:16 AM, LAKSHMAN PRASAD > <lakshman_...@yahoo.com>wrote: > > Dear All, > > If my input is 1215 or 12.15 converted to 12:15 of 12:15 > > > > > > *From:* Aamir Shahzad <aamirshahza...@gmail.com> > *To:* excel-macros@googlegroups.com > *Sent:* Thursday, March 29, 2012 12:22 AM > > *Subject:* Re: $$Excel-Macros$$ format a cell > > Now see the attached file. > > Aamir Shahzad > > > On Wed, Mar 28, 2012 at 11:07 AM, LAKSHMAN PRASAD > <lakshman_...@yahoo.com>wrote: > > Dear Noorain, > > I think he want 532, and I'd like to be converted to 05:32 > > > > *From:* NOORAIN ANSARI <noorain.ans...@gmail.com> > *To:* excel-macros@googlegroups.com > *Sent:* Wednesday, March 28, 2012 7:55 AM > > *Subject:* Re: $$Excel-Macros$$ format a cell > > Dear Pawel. > > Please try it.. > > =TIME(LEFT(C4,1),RIGHT(C4,2),0) > > -- > Thanks & regards, > Noorain Ansari > *http://noorainansari.com/* > *http://excelmacroworld.blogspot.com/*<http://excelmacroworld.blogspot.com/> > > > On Tue, Mar 27, 2012 at 7:35 PM, pawel lupinski <lupins...@yahoo.com>wrote: > > Hi All, > > I need your help on this simple task i don't know how to do this and for > you it will be easy. > > I'd like to input eg 532, and I'd like to be converted to 05:32 or input > 5.32 and be converted to 5:32. > > I've tried to change cell format like "hh:mm", "[hh]:mm" but its not > working what I've received as outcome is data and time format like > "12768:00" > > Can you help me, please. > > Regards, > > Pawel > -- > FORUM RULES (986+ members already BANNED for violation) > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > > 2) Don't post a question in the thread of another member. > > 3) Don't post questions regarding breaking or bypassing any security > measure. > > 4) Acknowledge the responses you receive, good or bad. > > 5) Cross-promotion of, or links to, forums competitive to this forum in > signatures are prohibited. > > NOTE : Don't ever post personal or confidential data in a workbook. Forum > owners and members are not responsible for any loss. > > > ------------------------------------------------------------------------------------------------------ > To post to this group, send email to excel-macros@googlegroups.com > > > > > > -- > FORUM RULES (986+ members already BANNED for violation) > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > > 2) Don't post a question in the thread of another member. > > 3) Don't post questions regarding breaking or bypassing any security > measure. > > 4) Acknowledge the responses you receive, good or bad. > > 5) Cross-promotion of, or links to, forums competitive to this forum in > signatures are prohibited. > > NOTE : Don't ever post personal or confidential data in a workbook. Forum > owners and members are not responsible for any loss. > > > ------------------------------------------------------------------------------------------------------ > To post to this group, send email to excel-macros@googlegroups.com > > > -- > FORUM RULES (986+ members already BANNED for violation) > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > > 2) Don't post a question in the thread of another member. > > 3) Don't post questions regarding breaking or bypassing any security > measure. > > 4) Acknowledge the responses you receive, good or bad. > > 5) Cross-promotion of, or links to, forums competitive to this forum in > signatures are prohibited. > > NOTE : Don't ever post personal or confidential data in a workbook. Forum > owners and members are not responsible for any loss. > > > ------------------------------------------------------------------------------------------------------ > To post to this group, send email to excel-macros@googlegroups.com > > > > > -- > Regards, > Aamir Shahzad > > -- > FORUM RULES (986+ members already BANNED for violation) > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > > 2) Don't post a question in the thread of another member. > > 3) Don't post questions regarding breaking or bypassing any security > measure. > > 4) Acknowledge the responses you receive, good or bad. > > 5) Cross-promotion of, or links to, forums competitive to this forum in > signatures are prohibited. > > NOTE : Don't ever post personal or confidential data in a workbook. Forum > owners and members are not responsible for any loss. > > > ------------------------------------------------------------------------------------------------------ > To post to this group, send email to excel-macros@googlegroups.com > > > -- > FORUM RULES (986+ members already BANNED for violation) > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > > 2) Don't post a question in the thread of another member. > > 3) Don't post questions regarding breaking or bypassing any security > measure. > > 4) Acknowledge the responses you receive, good or bad. > > 5) Cross-promotion of, or links to, forums competitive to this forum in > signatures are prohibited. > > NOTE : Don't ever post personal or confidential data in a workbook. Forum > owners and members are not responsible for any loss. > > > ------------------------------------------------------------------------------------------------------ > To post to this group, send email to excel-macros@googlegroups.com > > > -- > FORUM RULES (986+ members already BANNED for violation) > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > > 2) Don't post a question in the thread of another member. > > 3) Don't post questions regarding breaking or bypassing any security > measure. > > 4) Acknowledge the responses you receive, good or bad. > > 5) Cross-promotion of, or links to, forums competitive to this forum in > signatures are prohibited. > > NOTE : Don't ever post personal or confidential data in a workbook. Forum > owners and members are not responsible for any loss. > > > ------------------------------------------------------------------------------------------------------ > To post to this group, send email to excel-macros@googlegroups.com > > > -- > FORUM RULES (986+ members already BANNED for violation) > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > > 2) Don't post a question in the thread of another member. > > 3) Don't post questions regarding breaking or bypassing any security > measure. > > 4) Acknowledge the responses you receive, good or bad. > > 5) Cross-promotion of, or links to, forums competitive to this forum in > signatures are prohibited. > > NOTE : Don't ever post personal or confidential data in a workbook. Forum > owners and members are not responsible for any loss. > > > ------------------------------------------------------------------------------------------------------ > To post to this group, send email to excel-macros@googlegroups.com > -- > FORUM RULES (986+ members already BANNED for violation) > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > > 2) Don't post a question in the thread of another member. > > 3) Don't post questions regarding breaking or bypassing any security > measure. > > 4) Acknowledge the responses you receive, good or bad. > > 5) Cross-promotion of, or links to, forums competitive to this forum in > signatures are prohibited. > > NOTE : Don't ever post personal or confidential data in a workbook. Forum > owners and members are not responsible for any loss. > > > ------------------------------------------------------------------------------------------------------ > To post to this group, send email to excel-macros@googlegroups.com > > > -- > FORUM RULES (986+ members already BANNED for violation) > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > > 2) Don't post a question in the thread of another member. > > 3) Don't post questions regarding breaking or bypassing any security > measure. > > 4) Acknowledge the responses you receive, good or bad. > > 5) Cross-promotion of, or links to, forums competitive to this forum in > signatures are prohibited. > > NOTE : Don't ever post personal or confidential data in a workbook. Forum > owners and members are not responsible for any loss. > > > ------------------------------------------------------------------------------------------------------ > To post to this group, send email to excel-macros@googlegroups.com > -- FORUM RULES (986+ members already BANNED for violation) 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. ------------------------------------------------------------------------------------------------------ To post to this group, send email to excel-macros@googlegroups.com