我有一个非常基本的问题。谢谢你的帮助。
如果单元格中包含“男/男/女”或“女/女/女”,则返回“男/女”
为什么以下不起作用?我想确保它
=if(a1=(or("Men's/Mens/Men","Women's/Womens/Women"),"Male","Female")
例如:
Items Gender
O'Neill Women's Knot My Problem Tank Shirt Female
O'Neill Womens Love VW Tank Shirt Female
O'Neill Women India Armor Tank Shirt Female
O'Neill Men's Knows All Tank Shirt Male
O'Neill Mens Jack O'Neill Hookipa Short-Sleeve Shirt Male
O'Neill Men Welder Long-Sleeve Shirt Male
我知道我可以使用两个条件语句来完成这项工作,但有没有办法只使用一个if和使用其他一些函数?说OR?
谢谢你。答案 0 :(得分:2)
你正在使用“或”错误。
如果只有2个可能的答案(男性和女性):
=if(or(a1="Men's";a1="Mens";a1="Men");"Male";"Female")
除此之外,我使用嵌套的Ifs
答案 1 :(得分:0)
多次回答,即here
在你的情况下,这应该做的工作:
>>> s = 'param="(a, b)", param2, param3'
>>> re.findall(r'\s*((?:[^,\"]|\"[^\"]*\")+)\s*', s)
['param="(a, b)"', 'param2', 'param3']
>>> s = 'param="(a, b)" "more quotes" "yet,more,quotes", param2, param3'
>>> re.findall(r'\s*((?:[^,\"]|\"[^\"]*\")+)\s*', s)
['param="(a, b)" "more quotes" "yet,more,quotes"', 'param2', 'param3']