Problem with this formula

W

winnie123

Hi,

I have the following formula with which I am trying to calculate if we have
delivered on time. The result keeps giving me Early and I am not sure why.

=IF(N2<J2,"Early",IF(N2=J2,"On Time","Late"))

Colum N is the Agreed promised Date
Column J is the invoice Date which is an array formula that uses Index and
Match

I have tried to see if the array formula is making the calculation screw up
my manually entering the date in column J but still get Early as the answer,
Even though I put a date later than the Agreed Date.

I have checked to make sure Calculation mode is Automatic

Any Ideas on what I have done wrong


Thanks
Winnie
 
J

Jacob Skaria

Are the dates in date format. Can you try this formula in a new worksheet.
Enter the dates using Ctrl + semicolon and then edit.

If this post helps click Yes
 
P

Pete_UK

Perhaps cell N2 has been formatted as Text, so your entry for Agreed
Date looks like a date but isn't.

Hope this helps.

Pete
 
W

winnie123

Hi Jacob,

I created a new worksheet and entered the dates with Ctrl + semicolan and
the formula works.

Why is that??

The dates are currently imported from the network system we use. I have set
both columns to date format.

How can I overcome this without having to manually enter the dates?

Thanks for your assistance
 
J

Jacob Skaria

I am not sure whether this will work..(as desired)

--Can you pre-format the fields to date format...

--OR try the formula..(again depends on the text format of the date text
format)
=IF(DATEVALUE(N2)<DATEVALUE(J2),"Early",IF(N2=J2,"On Time","Late"))

If this post helps click Yes
 
D

David Biddulph

To check whether N2 and J2 are both real dates, try =ISNUMBER(N2) and
=ISNUMBER(J2)
My suspicion is that =ISNUMBER(J2) will be FALSE (and =ISTEXT(J2) would be
TRUE).
You might get away with changing your formula from
=IF(N2<J2,"Early",IF(N2=J2,"On Time","Late"))
to
=IF(N2<--J2,"Early",IF(N2=--J2,"On Time","Late"))
 
W

winnie123

Thanks I think the problem must be with the mask I have created to import the
data.
 
W

winnie123

Pete,

I thinks its the mask I have created to import the records. The date is set
to Charachter and not date format. So will redo my mask and then hopefully it
will work

Thanks
 
R

Ron Rosenfeld

Hi,

I have the following formula with which I am trying to calculate if we have
delivered on time. The result keeps giving me Early and I am not sure why.

=IF(N2<J2,"Early",IF(N2=J2,"On Time","Late"))

Colum N is the Agreed promised Date
Column J is the invoice Date which is an array formula that uses Index and
Match

I have tried to see if the array formula is making the calculation screw up
my manually entering the date in column J but still get Early as the answer,
Even though I put a date later than the Agreed Date.

I have checked to make sure Calculation mode is Automatic

Any Ideas on what I have done wrong


Thanks
Winnie

Most likely a problem with your data.

It may look like a date, but really be text. You can tell by
=ISTEXT(cell_ref). A date should --> FALSE
--ron
 
D

David Biddulph

Changing the *format* of a cell doesn't change its content, but merely
affects the way a number is *displayed*. If you've got text instead of a
number, changing format will have no effect.
If you need to change values from text to a real date, you will see a number
of suggestions in the archives of this group.

You might try Data/ Text to Columns/ and specify the relevant date format
when you get to the last stage of the wizard.
Another option is to copy a cell containing zer, and using Edit/ Paste
Special/ Add (or copy a 1, and use Edit/ Paste Special/ Multiply).

In the short term, though, if J2 is text have you tried my suggestion of
=IF(N2<--J2,... ?
 
J

Jacob Skaria

Fine. If that doesnt work let us know the date format..If the incoming date
format is all numerics with separators try =IF(N2+0)<(J2+0)...

If this post helps click Yes
 
W

winnie123

Your suggestion worked by putting -- in front of the cell.

I have also redone my import mask.

Thank you to everyone for your contributions, this has been annoying me all
day.
 

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