Forum menu
Excel Help
 

[Closed] Excel Help

Free Member
Joined: 13 years ago
Posts: 0
Topic starter   [#9724460]

I am trying to write a formula in Excel to copy a cell if the criteria of two other cells are filled in with certain text but am completely stumped.

This is what i'm looking to achieve;

Column D = Column C if Column A is W or X and Column B is Y of Z

Please can you help my sanity!

Thanks



   
Free Member
Joined: 11 years ago
Posts: 17313
 

in cell d1.....

=if(a1="W",C1,if(a1="X",C1,if(b1="Y",C1,if(b1="Z",C1,0))))

...assumes W,X, Y and Z are text strings and they're evaluated in that order for an exact match.



   
Full Member
Joined: 16 years ago
Posts: 8890
 

In D1

=IF(AND(OR(A1="W",A1="X"),OR(B1="Y",B1="Z")),C1,"")

If I'm understanding you correctly



   
Free Member
Joined: 13 years ago
Posts: 0
Topic starter  

Thank you very much Mr Panther, sanity is saved.



   
Free Member
Joined: 11 years ago
Posts: 17313
 

You're welcome.

As with most things, and as Rubber_Buccaneer has demonstrated, there's usually more than one way to achieve the same thing.

Some methods are more elegant than others.

I now expect a three page thread explaining why my simplistic , down and dirty method is clearly not the best one.

There may be VBA involved.



   
Full Member
Joined: 16 years ago
Posts: 8890
 

But Mr Panther has given you

Column D = Column C if Column A is W or X [s]and[/s] [b]or[/b] Column B is Y or Z



   
Free Member
Joined: 11 years ago
Posts: 17313
 

See?

Let the Excelling commence!

RB is right. I didn't read the question properly.



   
Full Member
Joined: 16 years ago
Posts: 8890
 

There may be VBA involved.

May I add 'should have been a database'

I didn't read the question properly.

In my experience it's very likely the user hasn't asked for what they actually wanted anyway ๐Ÿ™‚



   
Free Member
Joined: 13 years ago
Posts: 0
Topic starter  

I will admit I jumped the gun a bit in excel actually giving be a number rather than #VALUE, Rubber Buccaneer's formula is the correct one.

Thank you RB



   
Full Member
Joined: 17 years ago
Posts: 25941
 

Usually I'd do it in python*. This time though, pirate not panther

* whatever the holy hell python is