福舟仁 发表于 2021-10-18 09:47:41

=MID(A2,CONCAT(IFERROR(FIND({"男","女"},A2),"")),1) 三键结束下拉

浪奇天下 发表于 2021-10-19 04:03:33

=LOOKUP(1,-FIND({"","男","女"},A2),{"","男","女"})

贺老三 发表于 2021-11-5 09:53:05

=IF(COUNTIF(A2,"*男*"),"男","女")

艺术的疯狂 发表于 2021-11-6 10:52:04

大佬,我特意试了一下,将单元格都改成包含男女的内容,然后用公式试了一下,结果显示为女,为什么不显示男呢?

湖湘道医 发表于 2021-11-6 11:09:37

B2=LOOKUP(99,FIND({"男","女","男女","女男"},A2),{"男","女","男女","女男"})

鹰窠顶 发表于 2021-11-7 12:35:36

非常感谢

魔之霆 发表于 2021-11-19 11:54:33

Sub 宏1()
Dim rng As Range
On Error Resume Next
Set rng = Application.InputBox(prompt:="请选择你要替换的单元格区域", Title:="替换", Type:=8)
On Error GoTo 0
rng.Replace What:="*女男*", Replacement:="女男", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
rng.Replace What:="*男女*", Replacement:="男女", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
rng.Replace What:="*男*", Replacement:="男", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
rng.Replace What:="*女*", Replacement:="女", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
End Sub

郭海涛 发表于 2021-11-21 17:35:04

正则表达式,把“男”、“女”的之外的字符都替换为空:
[^男女]+

那就好 发表于 2021-11-27 09:48:52

=LOOKUP(99,FIND({"男","女"},A2),{"男","女"})

医养容 发表于 2021-12-2 14:41:57

=MID(A2,CONCAT(IFERROR(FIND({"男","女"},A2),"")),1) 三键结束下拉
页: 1 [2] 3
查看完整版本: 怎么提取Excel表格中特定字