最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Excel CONCATENATE that includes " in the result - Stack Overflow

programmeradmin2浏览0评论

I need to CONCATENATE a large table, so I can create a .csv string for a file import. The issue is that the system requires that all text fields are separated by ". In a CONCATENATE I am unable to add a " to a cell.

I have shortened the amount of columns to A and B for reference. Column A contains the first name and column B contains the last name. The end result should be "Gee","Washington".

When I use this function below I get Gee, Washington.

=CONCATENATE=(A2;",";B2)

When I add "" to the formula of the function, the result becomes ";A2;",";B2;".

=CONCATENATE(""";A2;""";",";""";B2;""")

What do I need to do to get " before and after the cell value in my CONCATENATE?

The ; is the separator I need to use and not , - I think because of country formats?

I need to CONCATENATE a large table, so I can create a .csv string for a file import. The issue is that the system requires that all text fields are separated by ". In a CONCATENATE I am unable to add a " to a cell.

I have shortened the amount of columns to A and B for reference. Column A contains the first name and column B contains the last name. The end result should be "Gee","Washington".

When I use this function below I get Gee, Washington.

=CONCATENATE=(A2;",";B2)

When I add "" to the formula of the function, the result becomes ";A2;",";B2;".

=CONCATENATE(""";A2;""";",";""";B2;""")

What do I need to do to get " before and after the cell value in my CONCATENATE?

The ; is the separator I need to use and not , - I think because of country formats?

Share Improve this question asked Mar 20 at 10:36 CustomXCustomX 10.1k30 gold badges89 silver badges115 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 2

(Note that my list separator is the comma, and not the semicolon as you show)

You can use the TEXTJOIN function:

="""" & TEXTJOIN(""",""",TRUE,A2,B2) & """"

If you must use the CONCATENATE function, then:

=CONCATENATE("""",A1,""",""",B1,"""")

I would use the CHAR function to ease things

"=CONCATENATE(CHAR(34),A2,CHAR(34),CHAR(44),CHAR(34),B2,CHAR(34))"

The result is "Gee","Washington"

发布评论

评论列表(0)

  1. 暂无评论