Viewing 10 posts - 1 through 10 (of 10 total)
  • Excel Help
  • longmover
    Free Member

    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

    perchypanther
    Free Member

    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.

    Rubber_Buccaneer
    Full Member

    In D1

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

    If I’m understanding you correctly

    longmover
    Free Member

    Thank you very much Mr Panther, sanity is saved.

    perchypanther
    Free Member

    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.

    Rubber_Buccaneer
    Full Member

    But Mr Panther has given you

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

    perchypanther
    Free Member

    See?

    Let the Excelling commence!

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

    Rubber_Buccaneer
    Full Member

    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 🙂

    longmover
    Free Member

    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

    scaredypants
    Full Member

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

    * whatever the holy hell python is

Viewing 10 posts - 1 through 10 (of 10 total)

The topic ‘Excel Help’ is closed to new replies.