选中要排序的列,执行下图操作:
假设数据在A列,在B1输入:
=lookup(9e+307,--left(substitute(a1,"A",),row($1:$100)))
下拉填充至记录末
再全选工作表-->数据-->排序-->列B按升序排序
用VBA可以实现
sub 排序()
dim va as range
call paixu(worksheets(1).range("a1:a24"))
end sub
function paixu(va)
dim x as range
dim st1 as string,st2,st3
i=1
for each x in va
st1=mid(x.value,5,1)
st2=mid(x.value,6,1)
if st2="三" and st1=1 then
set worksheets(1).cells(i,2)=x
i=i+1
elseif st2=1 then
set worksheets(1).cells(i,2).value=x
i=i+1
endif
next x
end funciton