If statement with two requirements

M

Matt

I am trying to write an IF statement with two requirements. I have a date
column and a text column. I would like the formula to give an end result of
"1" if the date cell is greater than a certain month AND if my text cell
equals a certain word. Can this be done?
 
B

Biff

Hi!

You haven't defined what you want if those conditions are
false.

These will return 1 if true and 0 if false:

=(MONTH(A1)>5)*(B1="word")

=--AND(MONTH(A1)>5,B1="word")

This one will leave the cell blank (not empty) if false:

=IF(AND(MONTH(A1)>5,B1="word"),1,"")

Biff
 
R

Ragdyer

One way.
Date column is A, and text column is B,
And with your criteria date in D1, and your criteria text in E1, try this:

=--AND(MONTH(A1)>MONTH($D$1),B1=$E$1)
And drag down to copy as needed.

This returns ones and zeroes.

If you'd rather have ones and *empty* cells, try this:

=IF(AND(MONTH(A1)>MONTH($D$1),B1=$E$1),1,"")
 
M

Matt

THANK YOU VERY MUCH!!!!!!! That was almost two hours of me ramming my head
in the wall because I couldn't figure it out. I kept trying to use
@IF(and(..... statements, but either they wouldn't work, or they worked a
different way so I kept thinking it was something that I didn't add.
Anyways. Thanks again for helping me with this!!
 

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