+ Reply to Thread
Results 1 to 2 of 2

Parsing data from a JSON column

Hybrid View

Waldorf Parsing data from a JSON... 09-22-2020, 11:15 AM
JeteMc Re: Parsing data from a JSON... 09-24-2020, 09:09 PM
  1. #1
    Registered User
    Join Date
    09-22-2020
    Location
    Ireland
    MS-Off Ver
    Office 365
    Posts
    1

    Parsing data from a JSON column

    I had a quick look and couldn't find anything directly related to this but apologies if I missed something.

    I have an excel sheet whereby one column is made of JSON data that is somewhat messy and I was hoping to filter it into multiple columns.

    This is an example of the text in the JSON column:

    {'gender': 'Male', 'nationality': 'IRL', 'document_type': 'passport', 'date_of_expiry': '2019-08-12', 'issuing_country': 'IRL'}
    {'gender': 'Female', 'document_type': 'driving_licence', 'date_of_expiry': '2023-02-28', 'issuing_country': 'GBR'}

    I have tried to use Text to Columns but I run into an issue because the data is jumbled so I end up with something like this:

    Screenshot 2020-09-22 at 16.09.55.png

    The problem with that is that 'nationality' and 'document_type' are added to the same column.

    Ideally, I would like the data in something like this format:

    Screenshot 2020-09-22 at 16.14.08.png

    Can anyone help? I am quite new to Excel so please be as descriptive as possible

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    19,043

    Re: Parsing data from a JSON column

    Hello Waldorf and Welcome to Excel Forum.
    In this proposal, as modeled in the attached file, the data from post #1 is placed into cells A2:A3
    The column headers, Gender, Nationality etc., are typed into cells B1:F1 with } being typed into G1
    The formula that parses the rest of the data is: =IFERROR(MID($A2,SEARCH(B$1,$A2)+LEN(B$1)+4,IFERROR(SEARCH(C$1,$A2),SEARCH(D$1,$A2))-(SEARCH(B$1,$A2)+LEN(B$1)+4)-IF(C$1="}",1,4)),"")
    For future reference you will usually get faster results if you utilize the instructions in the banner at the top of the page and upload a sample .xlsx file.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Parsing JSON
    By Lana74 in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 08-28-2020, 09:01 PM
  2. Passing a JSON request per row to an API and parsing response
    By johnmcafee in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-30-2020, 06:26 AM
  3. Edit JSON parser code to add function to write JSON file
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-16-2020, 09:28 PM
  4. Parsing JSON to excel
    By ErgoTeam in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-21-2016, 02:54 AM
  5. [SOLVED] Data Parsing - Segregating rows data under specific column headers - Macro creation
    By harman83 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-14-2016, 04:55 PM
  6. Parsing data in excel column. This should be simple for an expert. Please help!
    By velocitygraphix in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-25-2013, 07:48 PM
  7. [SOLVED] Pulling json or csv data from a url
    By Versial in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-10-2012, 04:43 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1