Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 25
Default INT Function Not Doing what I need

On my spreadsheet I have the following formula:

=IF(G420.001,INT(G4/20),0)

The reason for the 20.001 is because I only need the result of G4/20 if the
number is over 20. It works for 20 (gives me 0) and works for 21 which gives
me 1.

However if I enter 40 it gives me 2 which is what I am telling it to do.

What I need is if it is <20 it should be zero. It should be 1 for 21 to 40
and 2 for 41 etc etc
(i.e. 61 = 3, 81 = 4, 101 = 5)

Simply put:
0-20 i need 0
21-40 i need 1
41 to 60 i need 2
61 to 80 i need 3

and so on.....

Am I using the right formula?

Thanks,
Neil
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,393
Default INT Function Not Doing what I need

This works better
=INT(G4/20)-(MOD(G4,20)=0)

The second term subtracts 1 when you have 20, 40, 60 .....
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email


"Neil M" wrote in message
...
On my spreadsheet I have the following formula:

=IF(G420.001,INT(G4/20),0)

The reason for the 20.001 is because I only need the result of G4/20 if
the
number is over 20. It works for 20 (gives me 0) and works for 21 which
gives
me 1.

However if I enter 40 it gives me 2 which is what I am telling it to do.

What I need is if it is <20 it should be zero. It should be 1 for 21 to 40
and 2 for 41 etc etc
(i.e. 61 = 3, 81 = 4, 101 = 5)

Simply put:
0-20 i need 0
21-40 i need 1
41 to 60 i need 2
61 to 80 i need 3

and so on.....

Am I using the right formula?

Thanks,
Neil



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,389
Default INT Function Not Doing what I need

I think you want:

=int(g4/20)-1

Regards,
Fred.

"Neil M" wrote in message
...
On my spreadsheet I have the following formula:

=IF(G420.001,INT(G4/20),0)

The reason for the 20.001 is because I only need the result of G4/20 if
the
number is over 20. It works for 20 (gives me 0) and works for 21 which
gives
me 1.

However if I enter 40 it gives me 2 which is what I am telling it to do.

What I need is if it is <20 it should be zero. It should be 1 for 21 to 40
and 2 for 41 etc etc
(i.e. 61 = 3, 81 = 4, 101 = 5)

Simply put:
0-20 i need 0
21-40 i need 1
41 to 60 i need 2
61 to 80 i need 3

and so on.....

Am I using the right formula?

Thanks,
Neil


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 25
Default INT Function Not Doing what I need


YEEEEE HAAAAAA!!!!!!!

THank YOU, Bernard!!

Most Appreciated!!!

Neil M

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ISBLANK function not working when cell is blank dut to function re mcmilja Excel Discussion (Misc queries) 9 May 7th 23 03:43 AM
copy of excel file not showing formulal/function in the function b oaallam Excel Discussion (Misc queries) 4 September 6th 07 01:20 PM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Offset function with nested match function not finding host ss. MKunert Excel Worksheet Functions 1 March 21st 06 10:46 PM
Emulate Index/Match combo function w/ VBA custom function Spencer Hutton Excel Worksheet Functions 2 May 2nd 05 05:26 PM


All times are GMT +1. The time now is 08:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"