Formula to search site and populate expiry dates

ChrisFoster

Board Regular
Joined
Jun 21, 2019
Messages
246
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I have a list of ICO Registration numbers in column E on a worksheet.

Using Information Commissioner's Office - Register of data protection fee payers I can search for individual reference numbers and it provides information on that company such as address, contact details and the expiry date of the license/registration.
Using reference Z5347709 as an example, once the search button is pressed it takes me to URL Information Commissioner's Office - Register of data protection fee payers - Entry details - so basically
Excel Formula:
https://ico.org.uk/ESDWebPages/Entry/
and then the reference I am searching for.

What formula can I use to extract the date next to 'Registration expires:' on each reference number in column E rather than me having to manually search for each one?

Regards,

Chris
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
To extract the registration expiration date from the URL of the ICO website, you can use a combination of Excel's built-in functions, such as MID, FIND, and SUBSTITUTE. Here's an example formula you can use:

Excel Formula:
=IFERROR(MID(WEBSERVICE("https://ico.org.uk/ESDWebPages/Entry/" & E1),FIND("Registration expires:",WEBSERVICE("https://ico.org.uk/ESDWebPages/Entry/" & E1))+22,10),"")

This formula assumes that the ICO registration number you want to search for is in cell E1. You can adjust the cell reference as needed.

Here's a breakdown of the formula:

  1. WEBSERVICE function: This retrieves the HTML content of the ICO website page for the specific registration number.
  2. FIND function: This finds the position of the text "Registration expires:" in the HTML content.
  3. MID function: This extracts the substring from the HTML content starting from the position of "Registration expires:" and captures the next 10 characters (assuming the date format is always consistent).
  4. IFERROR function: This wraps the formula to handle cases where the registration expiration date is not found. It returns an empty string if there is an error.
Copy the formula to the adjacent cell of the ICO registration number, and it will extract the registration expiration date from the corresponding URL.
 
Upvote 0
To extract the registration expiration date from the URL of the ICO website, you can use a combination of Excel's built-in functions, such as MID, FIND, and SUBSTITUTE. Here's an example formula you can use:

Excel Formula:
=IFERROR(MID(WEBSERVICE("https://ico.org.uk/ESDWebPages/Entry/" & E1),FIND("Registration expires:",WEBSERVICE("https://ico.org.uk/ESDWebPages/Entry/" & E1))+22,10),"")

This formula assumes that the ICO registration number you want to search for is in cell E1. You can adjust the cell reference as needed.

Here's a breakdown of the formula:

  1. WEBSERVICE function: This retrieves the HTML content of the ICO website page for the specific registration number.
  2. FIND function: This finds the position of the text "Registration expires:" in the HTML content.
  3. MID function: This extracts the substring from the HTML content starting from the position of "Registration expires:" and captures the next 10 characters (assuming the date format is always consistent).
  4. IFERROR function: This wraps the formula to handle cases where the registration expiration date is not found. It returns an empty string if there is an error.
Copy the formula to the adjacent cell of the ICO registration number, and it will extract the registration expiration date from the corresponding URL.
Thanks but that hasnt worked. The result I get is '/dt>'
Did it work fine for you?
 
Upvote 0

Forum statistics

Threads
1,215,398
Messages
6,124,688
Members
449,179
Latest member
kfhw720

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