Get Last ID from string using formula

BroadbridgeDesign

New Member
Joined
Mar 2, 2018
Messages
1
Hi all,

I need to extract an ID number from this piece of text

{"success":true,"data":[{"id":312677,"sitemap_id":22728,"status":"finished","test_run":0,"sitemap_name":"watch-scraper","time_created":1519922954,"jobs_scheduled":0,"jobs_executed":2,"jobs_failed":0,"jobs_empty":0,"stored_record_count":1,"request_interval":1000,"page_load_delay":2000,"driver":"fast","scheduled":0},{"id":312686,"sitemap_id":22728,"status":"finished","test_run":0,"sitemap_name":"watch-scraper","time_created":1519923749,"jobs_scheduled":0,"jobs_executed":2,"jobs_failed":0,"jobs_empty":0,"stored_record_count":1,"request_interval":1000,"page_load_delay":2000,"driver":"fast","scheduled":0}],"current_page":1,"last_page":1,"total":2,"per_page":100}

Basically, every day a new line gets added ({"id":312686,"sitemap_id":22728,"status":"finished","test_run":0,"sitemap_name":"watch-scraper","time_created":1519923749,"jobs_scheduled":0,"jobs_executed":2,"jobs_failed":0,"jobs_empty":0,"stored_record_count":1,"request_interval":1000,"page_load_delay":2000,"driver":"fast","scheduled":0}],"current_page":1,"last_page":1,"total":2,"per_page":100}}

I need an excel formula to extract the last ID each time (in this case, 312686). I have tried to trim either side of the last {"id":, but did not have any luck

Any help would be greatly appreciated.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Hi. Put your text in A1. Try this formula:

=0+LEFT(TRIM(RIGHT(SUBSTITUTE(A1,"""id"":",REPT(" ",LEN(A1))),LEN(A1))),6)

It assumes its always 6 numbers.
 
Upvote 0

Forum statistics

Threads
1,223,099
Messages
6,170,107
Members
452,302
Latest member
TaMere

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