Cell formatting

L

LizJ

Hi, I have used lookup to return dates that I then want to use an IF function
to see whether the data matches. I have taken the data from two sources, one
gives me just the month, and the other provides the date in dd/mm/yyyy
format. What I want to know is when the month is the same. I have formatted
the dd/mm/yyyy cell to show the month, however, the underlying data is still
dd/mm/yyyy so when I use the if function I get an incorrect result. Is there
a way I can do this.

e.g.
Column A Column B
October October, but data is 30/10/2004
September June but data is 30/06/2004

In column C, I want to return whether the months are the same or not. Thanks
 
M

Max

Column A Column B
October October, but data is 30/10/2004
September June but data is 30/06/2004

One way

Try something along these lines in col C

In C2:

=IF(TEXT(B2,"mmmm")=A2,"Value_if_TRUE","Value_if_FALSE")

Copy down
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <at>yahoo<dot>com
----
LizJ said:
Hi, I have used lookup to return dates that I then want to use an IF function
to see whether the data matches. I have taken the data from two sources, one
gives me just the month, and the other provides the date in dd/mm/yyyy
format. What I want to know is when the month is the same. I have formatted
the dd/mm/yyyy cell to show the month, however, the underlying data is still
dd/mm/yyyy so when I use the if function I get an incorrect result. Is there
a way I can do this.

e.g.
Column A Column B
October October, but data is 30/10/2004
September June but data is 30/06/2004

In column C, I want to return whether the months are the same or not.
Thanks
 
L

LizJ

That seems to have worked a treat, thanks Max

Max said:
One way

Try something along these lines in col C

In C2:

=IF(TEXT(B2,"mmmm")=A2,"Value_if_TRUE","Value_if_FALSE")

Copy down
 

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