[英]How to filter Excel columns values by Ms-excel formula?
我想從數據下面獲取過濾器列字符串。
URL PreFix OutPut ConcatStrings
────────────────────────────────────────────────────────────────────────────────────────────────────────────────
http://AbCD.com/grouponorange-county | Deals | orangecounty | Dealsorangecounty
在,
Column-1第一列中有一個URL字符串。
列2此處有固定詞。 交易或任何固定的字符串
第3列要在此“ http://AbCD.com/groupon ”字符串之后獲取字符串
有一個orange-Country,然后刪除所有特殊字符,因此這里的輸出是orangeCountry。
Coulmn-4 ConcatString“ [Column-2] + [Column-3] ”
我如何在Microsoft Excel工作表中做。
第4欄:使用公式=B:B&C:C
。
第3列:如果您始終使用相同的主機名,則可以使用:
=SUBSTITUTE(A:A,"http://AbCD.com/groupon","")
如果主機名不同,請使用:
=RIGHT(A:A,LEN(A:A)-FIND("groupon",A:A)-LEN("groupon")+1)
(編輯)使用Alt+F11
進入VBA,轉到Insert
> Module
,並將其粘貼到:
Public Function remove_special_characters(s As String) As String
' based on code by Aaron Blood posted here:
' http://www.ozgrid.com/forum/showthread.php?t=55082&page=1
Dim cur_char As String
Dim i As Long
For i = 1 To Len(s)
cur_char = Mid(s, i, 1)
If cur_char Like "[A-Za-z0-9]" Then
remove_special_characters = remove_special_characters & cur_char
End If
Next i
End Function
然后,您可以在Excel中將=remove_special_characters()
用作上述函數的包裝器。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.