我在excel单元格中有以下文字:
SampleID: S-2016-011451 SubmitterID: EIROSSME Sample Name: T1 BTMs - 6/26/16 10:00 PM Lot Nbr: ProductID
:
我需要剪切数据,使其显示为:
T1 BTMs 6/26/16 22:00
我可以使用文字格式化日期($ cell," mm / dd / yy hh:mm")但是我无法获得= mid(...)来截断数据之间"姓名:"和" - "。
答案 0 :(得分:1)
1st: =mid(B2;63;26)
2nd: =mid(B5;1;8)
3rd: =mid(B5;11;18)
4th: =concatenate(B7;B8)
如果您想在Name:
和-
之间剪切,只需使用:
=find("Name: ";B2)
=find(" -";B2)
然后:
=mid(B2, find("Name: ";B2)+5;find(" -";B2)-find("Name: ";B2)-5)
即:
答案 1 :(得分:0)
使用SUBSTITUTE
进行更改,因此请同时使用SUBSTITUTE(a1,"Sample Name:","£££")
和SUBSTITUTE(a1,"PM Lot Nbr:","$$$")
,然后您将获得T1 BTM ...... $$$然后您就可以找到然后是£和$$$以及中间的实例,或者右边,然后是LEFT
这为您提供了切入点和切入点。你可以使用我们也在替换的值的查找,所以找到PM Lot Nbr等。
SUBSTITUTE(SUBSTITUTE(J1,"Sample Name","@@@"),"PM Lot Nbr","|||")
与此类似的东西(不完整,我将完成并整理)
=MID(SUBSTITUTE(SUBSTITUTE(J1,"Sample Name","@@@"),"PM Lot Nbr","|||"),LEN("@@@") + FIND("@@@",SUBSTITUTE(SUBSTITUTE(J1,"Sample Name","@@@"),"PM Lot Nbr","|||")),(FIND("|||",SUBSTITUTE(SUBSTITUTE(J1,"Sample Name","@@@"),"PM Lot Nbr","|||"))-FIND("@@@",SUBSTITUTE(SUBSTITUTE(J1,"Sample Name","@@@"),"PM Lot Nbr","|||"))-LEN("|||")))
答案 2 :(得分:0)