Excel if then problem

  • Thread starter Thread starter Jacqueline
  • Start date Start date
J

Jacqueline

What I want to do is this and I don't know how to do it.

I have 4 columns of data. (P to S).
I want to add another column.

The data in the new column depends of which of the four columns has an
data in it. Only one of P to S will have any data in any given row.

So, for example,

if (P is not empty) then output "blah"
if (Q is not empty) then output "dum"
if (R is not empty) then output "di"
if (S is not empty) then output "doodle"
if they are all empty then don't output anything.

Can someone help urgently please?


Thank you. Jacqueline Leac
 
=IF(NOT(ISBLANK(P4)),"blah","")&IF(NOT(ISBLANK(Q4)),"dum","")&IF(NOT(ISBLANK
(R4)),"di","")&IF(NOT(ISBLANK(S4)),"doodle","")
 
Last attempt was stoopid. Works, but this is shorter:

=IF(ISBLANK(P4),"","blah")&IF(ISBLANK(Q4),"","dum")&IF(ISBLANK(R4),"","di")&
IF(ISBLANK(S4),"","doodle")
 
If the entries will be text, you could use the following formula:


=IF(COUNTA(P2:S2),CHOOSE(MATCH("*",P2:S2,0),"blah","dum","di","doodle"),"")
 

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