简体   繁体   English

如何将数据从多列放入Excel中的一列

[英]how to put data from multiple columns into one column in excel

I am moving a site from magento to shopify and it's proving a little difficult. 我正在将网站从magento迁移到shopify,事实证明这有点困难。 For the products I sell, it's necessary to give the customer a number of specifications before they purchase (colour, material, weight, RAM, etc.) In magento it was possible to create a column in the csv for each of these specifications and add the relevant information in the cells and if the cell had data it would add that the the product page and if it didn't, it would omit that data from the product page. 对于我出售的产品,有必要在购买前给客户一些规格(颜色,材料,重量,RAM等)。在magento中,可以为每个这些规格在csv中创建一列并添加单元格中的相关信息,如果单元格中有数据,它将添加产品页面,如果没有,则会从产品页面中删除该数据。 Moving the shopify, this isn't a feature and requires me to consolidate all of this information into 1 column before upload. 移动shopify并不是一个功能,需要我在上载之前将所有这些信息合并到1列中。 Doing this can of course result in a number of issues - from missing information to incorrect html input (as the information is to be in a table format). 这样做当然会导致很多问题-从缺少信息到错误的html输入(因为信息将采用表格格式)。

I have provided a sample file here: https://docs.google.com/spreadsheets/d/1rFFqS20ED1S1cPCTixZm5ToyMhEow4VpVwapLj1ps38/edit?usp=sharing 我在这里提供了一个示例文件: https : //docs.google.com/spreadsheets/d/1rFFqS20ED1S1cPCTixZm5ToyMhEow4VpVwapLj1ps38/edit?usp=sharing

The idea is for the specifications (in this case colour , material, brand and weight) to be presented in a html table format for uploading. 想法是将规格(在这种情况下为颜色,材料,品牌和重量)以html表格格式显示以进行上传。 The column 'Body HTML' shows the desired output from each of the columns A:D. “正文HTML”列显示了每个A:D列的期望输出。 If there is data in the cell from columns A:D, the corresponding E cell of the same row will show that data along with the header; 如果在A:D列的单元格中有数据,则同一行的相应E单元格将显示该数据以及标题; if there is no data in the cell, the corresponding E cell of the same row will omit that piece of data along with the header. 如果该单元格中没有数据,则同一行的相应E单元格将忽略该数据段以及标头。

To put together the pieces that you want in column E, you can use the CONCATENATE function as follows: 要将所需的片段放到E列中,可以使用CONCATENATE函数,如下所示:

=CONCATENATE(s1,s2,s3,...)

Now, s1,s2,s3,... are the strings that you want to concatenate together derived from columns A to D. For each si , you use the IF function. 现在, s1,s2,s3,...是要连接在一起的字符串,它们是从列A到D派生的。对于每个si ,您都可以使用IF函数。 For example, for column A: 例如,对于列A:

IF(A1<>"",CONCATENATE("<td>Colour: ",A1,"</td>"),"")

which evaluates to "Colour: Red" if cell A1 is not empty, and "" otherwise. 如果单元格A1不为空,则结果为“颜色:红色”,否则为“”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM