[英]List of x/y values from a table in excel
I have a table in excel that contains values in row 1 x1,x2...xn and values in column A y1,y2...yn.我在 excel 中有一个表格,其中包含第 1 行 x1,x2...xn 中的值和 A 列 y1,y2...yn 中的值。 I need to populate column A in another spreadsheet with values "x1/y1", "x1/y2"..."xn/yn".
我需要使用值“x1/y1”、“x1/y2”...“xn/yn”填充另一个电子表格中的 A 列。 Is there a way to do this without creating a script in VBA?
有没有办法在 VBA 中不创建脚本的情况下做到这一点? Until now I was using just
=Sheet1!A2&"/"Sheet1!&B1
and draging it down and right and then manualy copying results to column A but as the table grows it becomes quite troublesome.到目前为止,我只使用
=Sheet1!A2&"/"Sheet1!&B1
并将其向下和向右拖动,然后手动将结果复制到 A 列,但随着表格的增长,它变得非常麻烦。
EDIT: Let me rephrase it so it could be more understandable my Sheet1 looks like编辑:让我改写一下,这样可以更容易理解我的 Sheet1 看起来像
| x1 | x2 | ... | xn | y1 | | | | | y2 | | | | | ... yn | | | | |
now I need to populate column A in Sheet2 so it would look like现在我需要在 Sheet2 中填充 A 列,所以它看起来像
x1/y1 x1/y2 ... x2/y1 x2/y2 ... xn/yn
Is it more understandable now?现在是不是更明白了?
You can use a couple of Index
formula to do this您可以使用几个
Index
公式来执行此操作
=IF(ROW() <= COUNTA(Sheet1!$A:$A) * COUNTA(Sheet1!$1:$1), INDEX(Sheet1!$1:$1,INT((ROW()-1)/COUNTA(Sheet1!$A:$A))+2)&"/"&INDEX(Sheet1!$A:$A,MOD(ROW()-1,COUNTA(Sheet1!$A:$A))+2),"")
Starting at Sheet2!A1
and copy down for at least the number of entries in the table.从
Sheet2!A1
开始,向下复制至少表中的条目数。 Any excess formula will show blanks.任何多余的公式将显示空白。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.