SOLVED

How can I set the value of a cell based on several conditions

Copper Contributor

Hello any help would be greatly appreciated from someone who knows more than I do. 

 

The Value of cell L2 can be "herself","himself", or should contain no value at all.  

 

If cell F2 is Not "he" or "she" L2 should contain no value
If cell F2 is Not "she" or blank L2 should be "himself"
If cell F2 is Not "he" or blank L2 should be "herself"

I've tried a variety of things but I'm having a hard time with this.


My latest attempt looks like this:

=IFS(OR(L2<>"herself",L2<>"himself"),"",OR(L2<>"herself",L2<>""),"himself",OR(L2<>"himself",L2<>""),"herself")

4 Replies
best response confirmed by Bad Wolf (Copper Contributor)
Solution

Hi Bad,

 

Perhaps

=SWITCH(F2,"he","himself", "she", "herself", "")

Thank you so much this work brilliantly! I can't believe it was that easy, Never heard of switch in excel until now. Thanks again :D

Your are welcome, glad to help. You may check this https://support.office.com/en-us/article/switch-function-47ab33c0-28ce-4530-8a45-d532ec4aa25e to know how the SWITCH works

Read and bookmarked. Very useful. Thank you.

1 best response

Accepted Solutions
best response confirmed by Bad Wolf (Copper Contributor)
Solution

Hi Bad,

 

Perhaps

=SWITCH(F2,"he","himself", "she", "herself", "")

View solution in original post