[英]compare 2 cells and update result in another cell in excel using xlwt python
I have excel that col A
and col B
like below: 我具有如下的col A
col B
和col B
:
A B
KIWI KIWI
APPLE APPLE
ORANGE BANANA
I need to compare the contents in col A and col B and if they matches write match/not match in col C like below. 我需要比较col A和col B中的内容,如果它们匹配,则在col C中写入匹配/不匹配,如下所示。
A B C
KIWI KIWI Matched
APPLE APPLE Matched
ORANGE BANANA Not Matched
I am using xlwt
to write excel.I can use xlrd
to read and xlwt
to write again.But to do this I need to open the same sheet twice. 我使用xlwt
写excel.I可以使用xlrd
阅读和xlwt
到again.But写要做到这一点,我需要两次打开同一张纸上。
please help me is there any better way to do this . 请帮助我,有什么更好的方法可以做到这一点。
您是否尝试过在C列中使用if比较公式而不是= if(a1 = b1,matched,not match)?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.