简体   繁体   English

如何基于Excel中另一列的单元格值更改列中的值?

[英]How to change values in a column based on cell values in another column in excel?

I read about if condition but apparently it only applies to single cell of two columns . 我了解了if条件,但显然它仅适用于two columns single cell I was wondering if there is way to modify the entire column based on cell values from another column. 我想知道是否有办法根据另一列的单元格值修改整个列。 For example 例如

=================            ================
       A                           B
=================            ================
     France                     Hong Kong
     USA                        New York
     China                      Hong Kong
     China                      New York

I want cell values in col A to change based on col B , so France becomes China in row 1 and China becomes USA in row 4 and so on. 我希望col A中的单元格值基于col B进行更改,因此法国在第1行中成为中国,在 中国在第4行中成为美国 ,依此类推。 Is there any way to accomplish this? 有什么办法可以做到这一点?

You need to have table or array ie 2 columns. 您需要有表或数组,即2列。 Then use this table/array in vlookup Refer link . 然后在vlookup参考链接中使用该表/数组。

Have a table in Sheet2 as follows. 在Sheet2中有一个表,如下所示。

=================  ================
       A                   B
=================  ================
      Delhi              India
      New York           USA
      Hong Kong          China

Then in first sheet use the following formula. 然后在第一页中使用以下公式。

=INDIRECT( "Sheet2!B" & MATCH(A1, Sheet2!A:A, 0) ) = INDIRECT(“ Sheet2!B”&MATCH(A1,Sheet2!A:A,0))

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

相关问题 根据另一列值填充 Excel 中的值 - Populating values in Excel based on another column of values 如何基于Excel中的另一个列值计算列的值? - How to calculate the value of a column based on another column values in Excel? Excel - 根据其他列值选择单元格 - Excel - Selecting cell based on other column values 如何基于已知单元格返回Excel行和列标题值? - How to return Excel row and column header values based on a known cell? 如何计算逗号,另一个单元格Excel中的所有列中的分隔值? - How To Count comma, another cell Separated Values In all Column In Excel? Excel:基于另一列中的值和映射的值求和的值 - Excel: Sum values based on values in another column and mapped values 如何根据列分片中的值与另一个表过滤Excel表? - How to filter an Excel table based on values in a column shard with another table? 如何将一张表中的列基于另一张表映射/拉到 excel 中的重复值? - how to map/pull column in 1 sheet based on another to repeating values in excel? Excel-如何根据另一列的条件值计算不同列值的总和 - Excel - How to calculate the sum of a different column values based on the conditional values of another column 使用 pandas 根据 Excel 中另一列中的值对列进行颜色编码 - Color code a column based on values in another column in Excel using pandas
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM