Online archive of questions on various topics answered by our experts. You can also ask a question (registration is required)
+95 votes
How can I use multiple cells containing text in an 'if' statement in Excel?
by (4.4k points)

4 Answers

+115 votes
 
Best answer
It would be something like this.... . =if(and(a3="done",a4="done",a5="done",. a6="done"),"complete","NOT")
by (4.3k points)
selected by
0 votes
If all the cells, a3,a4,a5,a6 must contain "done" and be true:. . =(if(and(a3,a4,a5.a6="done", "complete", ""))). I do hope the prenthesis are correct., since I have not tested this in Excel.. This translates as, if a3 = done, and a4 = done, and a5= done, and a6= done, (all true), then print "complete", otherwise ( " " ) print a void, if any one cell is false.. You could have it print "not done"., or anything else. Be sure that "text" contains enclosed quotes, unlike numbers. To print a void is just a double quote only. ( " " ). . If you wanted an "OR" statement, it is written the same way. This would answer if any cell was true. Sub "OR" for "AND".
by (4.2k points)
0 votes
go to help.......search for formulas........... a box will open.....Worksheet functions listed by category...............Text and Data at the bottom
by (4.2k points)
0 votes
Here's what you need to put in the cell:. . =IF(AND(A3 = "done", A4 = "done", A5 = "done", A6 = "done"), "complete", "not complete"). . Or this could also work:. . =IF(A3 = "done", IF(A4 = "done", IF(A5 = "done", IF(A6 = "done", "complete", "not complete"), "not complete"), "not complete"), "not complete"). . You can replace the text "not complete" with whatever you want it to say whenever all of the cells don't show "done".. . I tested both formulas and they work. If you do it like Edward said, when you delete one of the done's, it will not update like the two formulas I gave will. It will still show complete, even though done is missing in one of the cells.
by (4.4k points)
...