I have four variables in my excel sheet:
I am creating a new variable in Excel sheet geyser/heater/ac/aircooler which is the combination of all these four variables. If there is a Yes in any one of the above-mentioned columns than the newly created variables should also have "Yes" otherwise it should be blank.
I know how to do that using IF and OR statement for two columns but I don't know how to use it for Four columns.
If you have the latest version of Excel, you can use this:
=IF(OR(A1:D1="Yes"),"Yes","No")
Include one OR argument per contiguous range. In case column C is not included:
=IF(OR(A1:B1="Yes",D1:E1="Yes"),"Yes","No")
For older versions,
=IF(COUNTIF(A1:D1,"Yes")>0,"Yes","No")