Excel2003里这样的时间如何转换?9/28/2010 12:43:50 PM转换成09/29/2010 00:43:50
Excel2003里这样的时间如何转换?9/28/2010 12:43:50 PM转换成09/29/2010 00:43:50
有如下两点注意:1,格式 9/5/2010 10:30:06 PM要求变为09/05/2010 22:30
2,9/28/2010 12:43:50 PM转换后应是09/29/2010 00:43:50
如下公式:
=LEFT(A1,FIND(" ",A1))&IF(RIGHT(A1,2)="PM",TEXT(MID(A1,FIND(" ",A1)+1,FIND(" ",A1,FIND(" ",A1)+1)-FIND(" ",A1)-1)+12/24,"hh:mm:ss"),MID(A1,FIND(" ",A1)+1,FIND(" ",A1,FIND(" ",A1)+1)-FIND(" ",A1)-1))有缺陷,但我不会改,
9/28/2010 12:43:50 PM转换后是9/28/2010 00:43:50这是不对的
=IF(LEN(LEFT(A1,FIND("/",A1)))=2,"0"&LEFT(A1,FIND("/",A1)),LEFT(A1,FIND("/",A1)))&IF(MID(A1,FIND("/",A1)+2,1)="/","0"&MID(A1,FIND("/",A1)+1,2),MID(A1,FIND("/",A1)+1,3))&MID(A1,FIND(" ",A1)-4,5)&IF(RIGHT(A1,2)="PM",TEXT(MID(A1,FIND(" ",A1)+1,FIND(" ",A1,FIND(" ",A1)+1)-FIND(" ",A1)-1)+12/24,"hh:mm:ss"),MID(A1,FIND(" ",A1)+1,FIND(" ",A1,FIND(" ",A1)+1)-FIND(" ",A1)-1))