MegaSack DRAW - This year's winner is user - rgwb
We will be in touch
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
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.
In D1
=IF(AND(OR(A1="W",A1="X"),OR(B1="Y",B1="Z")),C1,"")
If I'm understanding you correctly
Thank you very much Mr Panther, sanity is saved.
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.
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
See?
Let the Excelling commence!
RB is right. I didn't read the question properly.
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 🙂
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
Usually I'd do it in python*. This time though, pirate not panther
* whatever the holy hell python is
