INT function

D

Dave F

What does the INT function do in this formula:

=IF(F7<0,"N/A",(INT(MONTH(TODAY())-MONTH(G7))/$L$1)*F7)

So far as I can tell, =MONTH(TODAY())-MONTH(G7), where G7 is 9/22/2006,
yields an integer, namely, 1. Why, then, would INT be in front of it?

Dave
 
D

Dave O

The formula also contains "divide the $L$1", which is also included in
the parens for the INT function. Does L1 contain a value that could
generate a non-integer number?
 
P

Pete_UK

Dave,

I agree with your supposition, so in answer to your question - I don't
know.

Have you tried to see what happens if you get rid of it?

Pete
 
K

Kevin B

The INT function isn't really necessary here. If NOW() had been used instead
of TODAY the result would have had a fractional time value in addition to the
serial date number. In that case INT would have stripped the time value,
leaving only the serial date number, but even then it would have been
unnecessary.
 
N

Niek Otten

Even more;

INT(MONTH(TODAY())

returns an integer

So indeed the INT seems superfluous

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

| What does the INT function do in this formula:
|
| =IF(F7<0,"N/A",(INT(MONTH(TODAY())-MONTH(G7))/$L$1)*F7)
|
| So far as I can tell, =MONTH(TODAY())-MONTH(G7), where G7 is 9/22/2006,
| yields an integer, namely, 1. Why, then, would INT be in front of it?
|
| Dave
| --
| Brevity is the soul of wit.
 
D

Dave F

Agreed, thanks.
--
Brevity is the soul of wit.


Pete_UK said:
Dave,

I agree with your supposition, so in answer to your question - I don't
know.

Have you tried to see what happens if you get rid of it?

Pete
 
D

Dave F

Hi--$L$1 is 48.0

In any event, it's not included in the INT() function. Take a look at the
formula again.

I've removed it from the formula and get the same result. The only thing I
can think of is that whoever originally made this spreadsheet either had a
use for it in its original form, or, else, didn't understand what INT is
supposed to do.

Dave
 
D

Dave F

Actually, Dave O is on to something. The closed bracket for the L1 term IS
part of the INT() function. Whoever made this function really messed it up!
The odd thing is it's calculating correctly.

Dave
 
K

Kevin B

Pete, what I said in the prior post is that the NOW() function would return a
fractional time amount, and of course, if enclosed in an INT the fractional
amount would be excluded from the result. So we're in agreement here.
However, INT is not necessary as MONTH(NOW()) will return an integer
regardless.

MONTH(NOW()) and MONTH(TODAY()) are going to return the same result, with
INT being excess baggage.
 
P

Pete_UK

The way I see it, F7 multiplies something in brackets, i.e.

(INT(MONTH(TODAY())-MONTH(G7))/$L$1)

and that simplifies to:

INT(something) / $L$1

so the L1 term is outside the INT function.

Pete
 

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