If/then question

Closed
Lmetz0804 - Nov 21, 2016 at 11:45 AM
yg_be Posts 22698 Registration date Sunday June 8, 2008 Status Contributor Last seen April 18, 2024 - Nov 21, 2016 at 05:08 PM
Hello,

If a cell contains any text except for one specific word, I want to return that exact text. If a cell is empty I want to return nothing.

For example:

If there is any text in B1, I want to write a formula that displays that text in A1. If B1 doesn't contain any text, I want the formula to leave A1 blank.

Thanks for your help!

1 response

TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 552
Nov 21, 2016 at 11:51 AM
Hi Lmetz0804,

Here you go:
=if(B1="","",B1)

Best regards,
Trowa
0
That was it! Thank you!
0
Lmetz0804 > Lmetz0804
Nov 21, 2016 at 12:22 PM
Actually, one more question. Can I also nest in one more level (in addition to the one you suggested) that says If B1 contains a specific text, return nothing.
0
yg_be Posts 22698 Registration date Sunday June 8, 2008 Status Contributor Last seen April 18, 2024 5
Nov 21, 2016 at 03:39 PM
if(B1="secret","",B1)
0
thanks, unfortunately, that didn't work. Here is an example of what I'm trying to do:

This formula does almost exactly what I need:
=IF('Project Schedule'!H7="","",'Project Schedule'!H7)

My only challenge is that sometimes the text, "1/0/00" appears in 'Project Schedule'!H7. I want excel to return nothing if that text is there.

So in short I want excel to:
1) return nothing if no text is in 'Project Schedule'!H7
2) return nothing if the text "1/0/00" appears in 'Project Schedule'!H7
3) return the exact contents if any other text is in 'Project Schedule'!H7

The formula above does all but number 2.

Thanks!
0
yg_be Posts 22698 Registration date Sunday June 8, 2008 Status Contributor Last seen April 18, 2024 5
Nov 21, 2016 at 04:49 PM
=IF('Project Schedule'!H7="1/0/00","",'Project Schedule'!H7)
(corrected : no double ")
0