简体   繁体   中英

Function using IF and AND and OR on a range of cells

I am trying to use an IF function in combination with AND and OR. I have several columns with text and I want a 1 or 0 (true or false):

if (cell1:cell10 == 'stringA' AND ('stringB' OR 'stringC') then return '1'  

otherwise, return '0'.

Beware, not properly tested by me!:

=--AND(NOT(ISERROR(VLOOKUP("stringA",A:A,1,0))),OR(NOT(ISERROR(VLOOKUP("stringB",A:A,1,0))),NOT(ISERROR(VLOOKUP("stringC",A:A,1,0)))))

Note I have covered the entire column cell1:cell10 (I assumed ColumnA) but range can be restricted to A1:A10 say, if desired.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM