ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   INT function (https://www.excelbanter.com/excel-discussion-misc-queries/113233-int-function.html)

Dave F

INT function
 
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.

Dave O

INT function
 
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?


Pete_UK

INT function
 
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

Dave F wrote:
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.



Pete_UK

INT function
 
No, the closed bracket for the INT function is before the L1 term.

Pete

Dave O wrote:
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?



Kevin B

INT function
 
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.

--
Kevin Backmann


"Dave F" wrote:

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.


Niek Otten

INT function
 
Even more;

INT(MONTH(TODAY())

returns an integer

So indeed the INT seems superfluous

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Dave F" wrote in message ...
| 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.



Dave F

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


"Pete_UK" wrote:

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

Dave F wrote:
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.




Dave F

INT function
 
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
--
Brevity is the soul of wit.


"Dave O" wrote:

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?



Dave F

INT function
 
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
--
Brevity is the soul of wit.


"Pete_UK" wrote:

No, the closed bracket for the INT function is before the L1 term.

Pete

Dave O wrote:
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?




Pete_UK

INT function
 
Kevin,

I disagree again - MONTH(NOW()) will return 10 for today.

Pete

Kevin B wrote:
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.

--
Kevin Backmann


"Dave F" wrote:

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.



Kevin B

INT function
 
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.
--
Kevin Backmann


"Pete_UK" wrote:

Kevin,

I disagree again - MONTH(NOW()) will return 10 for today.

Pete

Kevin B wrote:
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.

--
Kevin Backmann


"Dave F" wrote:

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.




Pete_UK

INT function
 
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

Dave F wrote:
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
--
Brevity is the soul of wit.


"Pete_UK" wrote:

No, the closed bracket for the INT function is before the L1 term.

Pete

Dave O wrote:
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?





Dave O

INT function
 
You're correct, I fubarred this one.


Pete_UK wrote:
....

so the L1 term is outside the INT function.



Dave F

INT function
 
Yeah, you're right.
--
Brevity is the soul of wit.


"Pete_UK" wrote:

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

Dave F wrote:
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
--
Brevity is the soul of wit.


"Pete_UK" wrote:

No, the closed bracket for the INT function is before the L1 term.

Pete

Dave O wrote:
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?






All times are GMT +1. The time now is 02:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com