Extract duplicate parameters and sum up the associated column values for the URLs

ekguru

New Member
Joined
Jan 23, 2014
Messages
14
I am trying to find out the urls by extracting common parameters (bolded in black) in the following sample urls and add the views/visits column values of these URLs that have the black bolded variables in common to essentially eliminate duplicate rows (as shown below)...have tried multiple things and yet not able to achieve the desired results..can someone please help me with this?

Couple of things:

1. The sequence of the parameters might be in different for each URL
2. Some of the parameters might have junk values associated (link traces from referral links) as you can see in the last two examples that will always be similar to the last two examples mentioned and might strip the & symbol from the URL
3. You can ignore any other parameters in the URLs
4. I can use VBA

Thanks


URL : Visits - Views

http://www.abc.com/index.ac?nav=price&queryProduct=ABC&request_locale=en&tab=0 : 100 - 200
http://www.abc.com/index.ac?nav=price&queryProduct=ABC&request_locale=en&tab=1 : 100 - 200
http://www.abc.com/index.ac?nav=price&queryProduct=CDE&request_locale=en&tab=0 : 100 - 200
http://www.abc.com/index.ac?nav=price&queryProduct=ABC&request_locale=en&source=un&tab=0 : 100 - 200
http://www.abc.com/index.ac?nav=prod&queryProduct=ABC&request_locale=en&tab=0 : 100 - 200
http://www.abc.com/index.ac?nav=price&queryProduct=CDE&request_locale=en&tab=1 : 100 - 200
http://www.abc.com/index.ac?request_locale=en/abc_index.htmltab=0/abc_index.htmlqueryProduct=ABC/abc_index.htmlnav=prod : 100 - 200
http://www.abc.com/index.ac?lang=E&request_locale=en/sub/cde/index2.jsptab=0/sub/cde/index2.jspqueryProduct=ABC/sub/cde/index2.jspnav=price?Curr=C : 100 - 200
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
I was able to extract the parameters using this formula - IFERROR(MID(A1, SEARCH(B1 & "=", A1) + LEN(B1) + 1, IFERROR(SEARCH("&", A1, SEARCH(B1 & "=", A1)) - SEARCH(B1 & "=", A1) - LEN(B1) - 1, LEN(A1))), "")


Can someone help with writing a macro to achieve the desired results.

I am trying to find out the urls by extracting common parameters (bolded in black) in the following sample urls and add the views/visits column values of these URLs that have the black bolded variables in common to essentially eliminate duplicate rows (as shown below)...have tried multiple things and yet not able to achieve the desired results..can someone please help me with this?

Couple of things:

1. The sequence of the parameters might be in different for each URL
2. Some of the parameters might have junk values associated (link traces from referral links) as you can see in the last two examples that will always be similar to the last two examples mentioned and might strip the & symbol from the URL
3. You can ignore any other parameters in the URLs
4. I can use VBA

Thanks


URL : Visits - Views

http://www.abc.com/index.ac?nav=price&queryProduct=ABC&request_locale=en&tab=0 : 100 - 200
http://www.abc.com/index.ac?nav=price&queryProduct=ABC&request_locale=en&tab=1 : 100 - 200
http://www.abc.com/index.ac?nav=price&queryProduct=CDE&request_locale=en&tab=0 : 100 - 200
http://www.abc.com/index.ac?nav=price&queryProduct=ABC&request_locale=en&source=un&tab=0 : 100 - 200
http://www.abc.com/index.ac?nav=prod&queryProduct=ABC&request_locale=en&tab=0 : 100 - 200
http://www.abc.com/index.ac?nav=price&queryProduct=CDE&request_locale=en&tab=1 : 100 - 200
http://www.abc.com/index.ac?request_locale=en/abc_index.htmltab=0/abc_index.htmlqueryProduct=ABC/abc_index.htmlnav=prod : 100 - 200
http://www.abc.com/index.ac?lang=E&request_locale=en/sub/cde/index2.jsptab=0/sub/cde/index2.jspqueryProduct=ABC/sub/cde/index2.jspnav=price?Curr=C : 100 - 200
 
Upvote 0
Bump..

I was able to extract the parameters using this formula - IFERROR(MID(A1, SEARCH(B1 & "=", A1) + LEN(B1) + 1, IFERROR(SEARCH("&", A1, SEARCH(B1 & "=", A1)) - SEARCH(B1 & "=", A1) - LEN(B1) - 1, LEN(A1))), "")


Can someone help with writing a macro to achieve the desired results.
 
Upvote 0

Forum statistics

Threads
1,216,087
Messages
6,128,740
Members
449,466
Latest member
Peter Juhnke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top