Need help with if-then statement in formula

M

mcmilja

Hello, I need to create a formula that looks in cell B2 and B3 and if either
cell B2 or B3 contains "TRUE", then it returns a "TRUE".

Thanks!
Jaret
 
M

Mike H

Try this

=OR(B2=TRUE,B3=TRUE)

and if you don't want it to display false try this

=IF(OR(B2=TRUE,B3=TRUE),TRUE,"")

Mike
 
M

mcmilja

Hello Mike, thank you very much for these formulas they work like a champ if
the cell contains text! Now here's another challenge for you: what if the
cells B2 and B3 are formulas that produce a "TRUE" statement which is not
text. I know I can copy > paste special > values to change the formula to
text but I'd rather not have to go through that step since the data I'm
working with is constantly being updated.

Again, thanks for your expertise!
Jaret
 
M

Mike H

Hi,

I don't understand the formula work if the TRUE in B2 or B3 is the result of
a formula or a text entry, what formula are you using that causes it not to
work?


For example in B2
=A2=1
in B3
=A3=1

These 2 formula evaluate as TRUE/FALSE if A2/A3 have a 1 in them and the
formula works.

Mike
 
M

mcmilja

Hey Mike,

I'm not sure I can easily explain what I'm doing to produce the results for
B2 and B3 which is really M2 and N2 on my excel worksheet but I'll give it a
shot.

The data in cell K2 is a router port (t1-0/0/0:1:1), cell L2 is the router
status which is either (null) or #N/A (depending on the port type) and cell
M2 produces "TRUE" if the status in (null) and N2 produces "TRUE" if the
status is #N/A. O2 would use the formula that you provided me which will
produce "TRUE" if either M2 or N2 is "TRUE".

Cell M2 uses the following formula to produce a "TRUE" statement:
=SUBSTITUTE(B2,"(null)","TRUE")

Cell N2 uses the following formula to produce a "TRUE":
=ISNA(L46) produces "TRUE" if the cell contains #N/A

Example:
K2 L2 M2 N2 O2
Router Port |Port Status |Status if (null) |Status if #N/A |Port Spare

t1-0/0/0:1:1 |(null) |TRUE |FALSE |TRUE
lsq-0/1/0.1 |#N/A |FAlSE |TRUE |TRUE

Clear as mud?

Thanks,
Jaret
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top