Fill Cell that includes text in quotes plus data from other cells

pigsfoot

Board Regular
Joined
Dec 13, 2007
Messages
61
Office Version
  1. 365
Apologies for the title, i couldn't find an easy way to explain what i an trying to do.

I have to create a CSV file to import address data into a CRM. The CSV expects the data to be input as follows

Excel Formula:
{"city": "", "state": "", "address": "East Suffolk House\r\nStation Road\r\nMelton\r\nWoodbridge", "country": "GB", "postcode": "IP12 1RT"}

The data i need build that line with is in cells as per the image below. Cell H1 would be where it says East Suffolk above and so on through to Postcode which is column L

1738929076730.png


The problem i'm having is because the CSV code includes quote's i can't seem to create a formula that includes them as text because the " means something within the formula itself.. .if that makes sense.

Is there a way around this ? Thanks
 
Last edited:

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
If I understand your requirement correctly then to get the quotes in you need to 'quote the quotes' as it were.

So for example to get the value of H1 into the address with quotes you would do =""" & H1 & """.
 
Upvote 0
Murray is one quotation mark short, it would need to be 4 quotes:
Excel Formula:
="""" &H1&""""
Something like this might be cleaner.
Excel Formula:
=LET(x,CHAR(34),x & H1 & x)

It would help if you also showed us your current formula. If some of the values are hardcoded then using Substitute might reduce the length of the formula ie:
Excel Formula:
=LET(x,CHAR(34),
str,"|city|: ||, |state|: ||, |address|:" & x & A1 & x,
SUBSTITUTE(str,"|",CHAR(34)))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,226,466
Messages
6,191,196
Members
453,646
Latest member
SteenP

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