Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

If cell A1 = abcd, cell B1 = abcdefg, then what formula to use in order to get the text difference efg?

share|improve this question
1  
Thank you for mentioning the cell references - these make answering easier and sometimes MUCH easier! –  pnuts Dec 12 '12 at 10:44
    
What would you expect the answer to be if A1 = bcd and B1 = adefg ? –  Lee Taylor Dec 12 '12 at 10:48
    
I expect nothing to happen (tested it of course in advance), because the string isn't present in the other string. @Lee: what would you expect? –  Jacob Jan Tuinstra Dec 12 '12 at 11:04
    
@JacobJanTuinstra - I was trying to get the OP to suggest what he was trying to achieve. I don't it's completely clear what he's asking for. After all what does "text difference" mean? –  Lee Taylor Dec 12 '12 at 12:26
3  
@JacobJanTuinstra Hmmm, so the text difference should be all the characters in B1 that are not in A1? So, with A1 = bcd and B1 = adefg this would be aefg? Do you not see the ambiguity? –  Lee Taylor Dec 12 '12 at 13:04

1 Answer 1

By using the following formula, you can achieve just that:

=SUBSTITUTE(B1,A1,"")

Reference: SUBSTITUTE

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.