Function to check list for specific conditions and return an answe

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a list of five cells which may contain any one of the following
numbers 017, 030,0. In another cell i want to do the following:
If all five cells only contain 017 or 0 then return a value of 017
If all five cells only contain 030 or 0 then return a value of 030
If all five cells contain a combination of all three numbers the cell to
show "Check"
 
Try this
=IF(COUNTIF(A1:A5,"017")+COUNTIF(A1:A5,0)=5,"017",IF(COUNTIF(A1:A5,"030")+COUNTIF(A1:A5,0)=5,"030",IF(COUNTIF(A1:A5,"017")+COUNTIF(A1:A5,"030")+COUNTIF(A1:A5,0)=5,"Check","-")))

Ola
 
Hi Tanya,

I think this does it

=IF(OR(COUNTIF(A1:A5,"017")=5,COUNTIF(A1:A5,"0")=5),"017",IF(COUNTIF(A1:A5,"
030")=5,"030","Check"))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top