ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   if then formula (https://www.excelbanter.com/excel-worksheet-functions/147920-if-then-formula.html)

ann

if then formula
 
my logic isn't working here. i have if a1=multiple of 60, then return a1
otherwise return 0. can i do a "multiple of 60? - for example 60, 120, 180
etc...or i can hard code these since it's only up to 360.

Dave Peterson

if then formula
 
=if(mod(a1,60)=0,a1,0)
or equivalently
=a1*(mod(a1,60)=0)

Ann wrote:

my logic isn't working here. i have if a1=multiple of 60, then return a1
otherwise return 0. can i do a "multiple of 60? - for example 60, 120, 180
etc...or i can hard code these since it's only up to 360.


--

Dave Peterson

T. Valko

if then formula
 
Try this:

=IF(MOD(A1,60),0,A1)

Biff

"Ann" wrote in message
...
my logic isn't working here. i have if a1=multiple of 60, then return a1
otherwise return 0. can i do a "multiple of 60? - for example 60, 120,
180
etc...or i can hard code these since it's only up to 360.




ann

if then formula
 
perfect, that worked! thanks again

"T. Valko" wrote:

Try this:

=IF(MOD(A1,60),0,A1)

Biff

"Ann" wrote in message
...
my logic isn't working here. i have if a1=multiple of 60, then return a1
otherwise return 0. can i do a "multiple of 60? - for example 60, 120,
180
etc...or i can hard code these since it's only up to 360.





Gord Dibben

if then formula
 
Try this entered in B1

=IF(INT(A1/60=INT(A1/60)),A1,0)


Gord Dibben MS Excel MVP


On Mon, 25 Jun 2007 14:22:00 -0700, Ann wrote:

my logic isn't working here. i have if a1=multiple of 60, then return a1
otherwise return 0. can i do a "multiple of 60? - for example 60, 120, 180
etc...or i can hard code these since it's only up to 360.



T. Valko

if then formula
 
You're welcome. Thanks for the feedback!

Biff

"Ann" wrote in message
...
perfect, that worked! thanks again

"T. Valko" wrote:

Try this:

=IF(MOD(A1,60),0,A1)

Biff

"Ann" wrote in message
...
my logic isn't working here. i have if a1=multiple of 60, then return
a1
otherwise return 0. can i do a "multiple of 60? - for example 60, 120,
180
etc...or i can hard code these since it's only up to 360.








All times are GMT +1. The time now is 11:52 PM.

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