I have a set of data which I need to sort based on some relatively simple criteria. The difficulty I am having is how to capture the interdepencies of the logic of the sort criteria. Written in plain English, I am trying to do the following.
-If a record has an email address, categorise as "Evite"
-If there is no email address, but there is a mailing address, then sort on country and categorise as either "Mail - Canada", "Mail - USA", or "Mail - International".
-If there is no email or mail address, categorise as "No Contact Info"
-If there are notes in the data that indicate this person does not want to be contacted, cateogise as "Do not invite".
-If someone has a note saying "no email" but a mailing address is present, ignore this note.
Here is a snap of my data:
Pasteboard — Uploaded Image
Here is my formula so far:
{=IF(COUNTA(D2:F2),"Do not invite",IF(COUNTA(G2:I2),"Check SC",IF(COUNTA(K2),"Evite",IF(COUNT(SEARCH($U$2,M2)),"Mail - Canada",IF(COUNT(SEARCH($U$3,M2)),"Mail - USA",IF(COUNT(SEARCH(Countries,M2)),"Mail - International",IF(COUNTA(K2:M2),"","No Contact Info")))))))}
This formula is correct in most cases. Where I'm failing is at the last rule. I cannot work out how to get the formula to ignore the "No Email" note if there is a mailing address. How could I do this? This is the issue that I need to solve the most and would really appreciate any help with.
Another inelegant solution in this formula so far is that for the categorisation of "Mail - International", I am checking the value of the address country cell against a range of all the countries in the world that aren't Canada or the USA, when really I just need to check if that cell does not equal USA or Canada. However, when I tried this it interfered with the formula and began returning "No Contact Info" or "Evite" rather than "Mail - International". Thoughts?
Note I am using Excel 2010.
Thanks in advance.
-If a record has an email address, categorise as "Evite"
-If there is no email address, but there is a mailing address, then sort on country and categorise as either "Mail - Canada", "Mail - USA", or "Mail - International".
-If there is no email or mail address, categorise as "No Contact Info"
-If there are notes in the data that indicate this person does not want to be contacted, cateogise as "Do not invite".
-If someone has a note saying "no email" but a mailing address is present, ignore this note.
Here is a snap of my data:
Pasteboard — Uploaded Image
Here is my formula so far:
{=IF(COUNTA(D2:F2),"Do not invite",IF(COUNTA(G2:I2),"Check SC",IF(COUNTA(K2),"Evite",IF(COUNT(SEARCH($U$2,M2)),"Mail - Canada",IF(COUNT(SEARCH($U$3,M2)),"Mail - USA",IF(COUNT(SEARCH(Countries,M2)),"Mail - International",IF(COUNTA(K2:M2),"","No Contact Info")))))))}
This formula is correct in most cases. Where I'm failing is at the last rule. I cannot work out how to get the formula to ignore the "No Email" note if there is a mailing address. How could I do this? This is the issue that I need to solve the most and would really appreciate any help with.
Another inelegant solution in this formula so far is that for the categorisation of "Mail - International", I am checking the value of the address country cell against a range of all the countries in the world that aren't Canada or the USA, when really I just need to check if that cell does not equal USA or Canada. However, when I tried this it interfered with the formula and began returning "No Contact Info" or "Evite" rather than "Mail - International". Thoughts?
Note I am using Excel 2010.
Thanks in advance.