用公式填充单元格,调整一个字段,并保留另一个字段

时间:2019-01-14 11:14:24

标签: excel

我在单元格K40中具有以下公式:

=CONCATENATE("['",B39,"' => '",B40,"', '",C39,"' => ",C40,", '",D39,"' => '",D40,"', '",E39,"' => '",E40,"', '",F39,"' => '",F40,"', '",G39,"' => '",G40,"', '",H39,"' => '",H40,"', '",I39,"' => '",I40,"', '",J39,"' => '",J40,"'],")

以及单元格K41中的此公式:

=CONCATENATE("['",B39,"' => '",B41,"', '",C39,"' => ",C41,", '",D39,"' => '",D41,"', '",E39,"' => '",E41,"', '",F39,"' => '",F41,"', '",G39,"' => '",G41,"', '",H39,"' => '",H41,"', '",I39,"' => '",I41,"', '",J39,"' => '",J41,"'],")

如您所见,对于每一行,每个奇数字段都必须保持原样,而每个偶数字段都需要增加。

鉴于这两个单元格,我尝试为表中的其余行填写此公式,但对于单元格K42,Excel将该字段填充为:

=CONCATENATE("['",B41,"' => '",B42,"', '",C41,"' => ",C42,", '",D41,"' => '",D42,"', '",E41,"' => '",E42,"', '",F41,"' => '",F42,"', '",G41,"' => '",G42,"', '",H41,"' => '",H42,"', '",I41,"' => '",I42,"', '",J41,"' => '",J42,"'],")

但应填充为:

=CONCATENATE("['",B39,"' => '",B42,"', '",C39,"' => ",C42,", '",D39,"' => '",D42,"', '",E39,"' => '",E42,"', '",F39,"' => '",F42,"', '",G39,"' => '",G42,"', '",H39,"' => '",H42,"', '",I39,"' => '",I42,"', '",J39,"' => '",J42,"'],")

我该如何实现?

1 个答案:

答案 0 :(得分:1)

尝试使用$输入公式,它将固定行,因此在使用公式时不会对其进行调整:

=CONCATENATE("['",B$39,"' => '",B40,"', '",C$39,"' => ",C40,", '",D$39,"' => '",D40,"', '",E$39,"' => '",E40,"', '",F$39,"' => '",F40,"', '",G$39,"' => '",G40,"', '",H$39,"' => '",H40,"', '",I$39,"' => '",I40,"', '",J$39,"' => '",J40,"'],")