简体   繁体   中英

How to filter Excel columns values by Ms-excel formula?

I want to get filter column string from below Data.

                    URL                          PreFix              OutPut             ConcatStrings
────────────────────────────────────────────────────────────────────────────────────────────────────────────────
    http://AbCD.com/grouponorange-county    |     Deals   |    orangecounty |    Dealsorangecounty

In,
Column-1 first column there is an URL string.
Column-2 There is fixed words here ex. Deals or any fixed string
Column-3 Want to get string after this " http://AbCD.com/groupon " string
there is orange-Country then remove all special character so here output is orangeCountry.
Coulmn-4 ConcatString " [Column-2] + [Column-3] "

How I can do in Microsoft Excel sheet.

Column 4: use the formula =B:B&C:C .

Column 3: if you always have the same hostname, you can use:

=SUBSTITUTE(A:A,"http://AbCD.com/groupon","")

If it has a different hostname, use:

=RIGHT(A:A,LEN(A:A)-FIND("groupon",A:A)-LEN("groupon")+1)

(edit) Use Alt+F11 to go into VBA, go to Insert > Module , and paste this in:

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

You can then use =remove_special_characters() in Excel as a wrapper around the functions above.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM