Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
TSK TSK is offline
external usenet poster
 
Posts: 21
Default How to set the value to zero if it negative after the substract

Please advise

Q1: When applying the formula, D will show -38 but i need excel to change it
to zero and recongized it as number zero, otherwise when I multiple other
cell with this cell it will give value - Example 1.

Q2: However, I would also need cell D1 to reflect the number if it is not
zero or negative number - Example 2

Example 1

A1 - 01 Mar 2001 (Start Date)
B1 - 01 Mar 2006 (End Date)
C1 - 31 May 2008 (Audit Date)
D1 - (YEAR(B1)-YEAR(C1))*12+MONTH(B1)-MONTH(C1) = 0 instead of -38


Example 2

A1 - 01 Mar 2001 (Start Date)
B1 - 01 Jun 2010 (End Date)
C1 - 31 May 2008 (Audit Date)
D1 - I had this formula in cell D1:
(YEAR(B1)-YEAR(C1))*12+MONTH(B1)-MONTH(C1) = 25


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default How to set the value to zero if it negative after the substract

One way...

=MAX(0,(YEAR(B1)-YEAR(C1))*12+MONTH(B1)-MONTH(C1))

Rick


"TSK" wrote in message
...
Please advise

Q1: When applying the formula, D will show -38 but i need excel to change
it
to zero and recongized it as number zero, otherwise when I multiple other
cell with this cell it will give value - Example 1.

Q2: However, I would also need cell D1 to reflect the number if it is not
zero or negative number - Example 2

Example 1

A1 - 01 Mar 2001 (Start Date)
B1 - 01 Mar 2006 (End Date)
C1 - 31 May 2008 (Audit Date)
D1 - (YEAR(B1)-YEAR(C1))*12+MONTH(B1)-MONTH(C1) = 0 instead of -38


Example 2

A1 - 01 Mar 2001 (Start Date)
B1 - 01 Jun 2010 (End Date)
C1 - 31 May 2008 (Audit Date)
D1 - I had this formula in cell D1:
(YEAR(B1)-YEAR(C1))*12+MONTH(B1)-MONTH(C1) = 25



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
TSK TSK is offline
external usenet poster
 
Posts: 21
Default How to set the value to zero if it negative after the substrac

Thank you Rick.

Can you advise the how to set the value to zero on the following example

Example

Cell D - 0
Cell E - 0
Cell F - Reflect 0 instead of #DIV/0! when cell E/Cell D

"Rick Rothstein (MVP - VB)" wrote:

One way...

=MAX(0,(YEAR(B1)-YEAR(C1))*12+MONTH(B1)-MONTH(C1))

Rick


"TSK" wrote in message
...
Please advise

Q1: When applying the formula, D will show -38 but i need excel to change
it
to zero and recongized it as number zero, otherwise when I multiple other
cell with this cell it will give value - Example 1.

Q2: However, I would also need cell D1 to reflect the number if it is not
zero or negative number - Example 2

Example 1

A1 - 01 Mar 2001 (Start Date)
B1 - 01 Mar 2006 (End Date)
C1 - 31 May 2008 (Audit Date)
D1 - (YEAR(B1)-YEAR(C1))*12+MONTH(B1)-MONTH(C1) = 0 instead of -38


Example 2

A1 - 01 Mar 2001 (Start Date)
B1 - 01 Jun 2010 (End Date)
C1 - 31 May 2008 (Audit Date)
D1 - I had this formula in cell D1:
(YEAR(B1)-YEAR(C1))*12+MONTH(B1)-MONTH(C1) = 25




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default How to set the value to zero if it negative after the substrac

Assuming Row 1...

=IF(D1=0,0,E1/D1)

Rick


"TSK" wrote in message
...
Thank you Rick.

Can you advise the how to set the value to zero on the following example

Example

Cell D - 0
Cell E - 0
Cell F - Reflect 0 instead of #DIV/0! when cell E/Cell D

"Rick Rothstein (MVP - VB)" wrote:

One way...

=MAX(0,(YEAR(B1)-YEAR(C1))*12+MONTH(B1)-MONTH(C1))

Rick


"TSK" wrote in message
...
Please advise

Q1: When applying the formula, D will show -38 but i need excel to
change
it
to zero and recongized it as number zero, otherwise when I multiple
other
cell with this cell it will give value - Example 1.

Q2: However, I would also need cell D1 to reflect the number if it is
not
zero or negative number - Example 2

Example 1

A1 - 01 Mar 2001 (Start Date)
B1 - 01 Mar 2006 (End Date)
C1 - 31 May 2008 (Audit Date)
D1 - (YEAR(B1)-YEAR(C1))*12+MONTH(B1)-MONTH(C1) = 0 instead of -38


Example 2

A1 - 01 Mar 2001 (Start Date)
B1 - 01 Jun 2010 (End Date)
C1 - 31 May 2008 (Audit Date)
D1 - I had this formula in cell D1:
(YEAR(B1)-YEAR(C1))*12+MONTH(B1)-MONTH(C1) = 25





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
TSK TSK is offline
external usenet poster
 
Posts: 21
Default How convert to hours & minutes

Hi Rick,

Thank you very much. I had another question posted in the threat but there
is no replied. Perhaps can you tried to help me out too. The function I need,
seem to be very much complicated to figure out by myself.

I need to calculate the time & power consumption A1 - A2 are data input, A3
is result and I would liked to insert formula to do the calculation

A1 : 2,500 (Qty)
A2 : 23 (Qty Output in 1 minute)
A3 : Time required (Round up to the next higher minute)


Please advise, is my formula is correct and can you advise me how do I do
convert the result into hour and minutes as A3 show 1.82

A3 : roundup(A1/A2/60) = 1.82




"Rick Rothstein (MVP - VB)" wrote:

Assuming Row 1...

=IF(D1=0,0,E1/D1)

Rick


"TSK" wrote in message
...
Thank you Rick.

Can you advise the how to set the value to zero on the following example

Example

Cell D - 0
Cell E - 0
Cell F - Reflect 0 instead of #DIV/0! when cell E/Cell D

"Rick Rothstein (MVP - VB)" wrote:

One way...

=MAX(0,(YEAR(B1)-YEAR(C1))*12+MONTH(B1)-MONTH(C1))

Rick


"TSK" wrote in message
...
Please advise

Q1: When applying the formula, D will show -38 but i need excel to
change
it
to zero and recongized it as number zero, otherwise when I multiple
other
cell with this cell it will give value - Example 1.

Q2: However, I would also need cell D1 to reflect the number if it is
not
zero or negative number - Example 2

Example 1

A1 - 01 Mar 2001 (Start Date)
B1 - 01 Mar 2006 (End Date)
C1 - 31 May 2008 (Audit Date)
D1 - (YEAR(B1)-YEAR(C1))*12+MONTH(B1)-MONTH(C1) = 0 instead of -38


Example 2

A1 - 01 Mar 2001 (Start Date)
B1 - 01 Jun 2010 (End Date)
C1 - 31 May 2008 (Audit Date)
D1 - I had this formula in cell D1:
(YEAR(B1)-YEAR(C1))*12+MONTH(B1)-MONTH(C1) = 25








  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default How convert to hours & minutes

Firstly, if you look in excel help for the ROUNDUP function, you'll see that
it needs a second argument, the number of digits.

Secondly, Excel times are in unit of one day, so you'll need to divide by 24
hours.

Try =ROUNDUP(A1/A2,0)/(60*24) and format as [h]:mm or whatever format suits
you.
--
David Biddulph

"TSK" wrote in message
...
Hi Rick,

Thank you very much. I had another question posted in the threat but there
is no replied. Perhaps can you tried to help me out too. The function I
need,
seem to be very much complicated to figure out by myself.

I need to calculate the time & power consumption A1 - A2 are data input,
A3
is result and I would liked to insert formula to do the calculation

A1 : 2,500 (Qty)
A2 : 23 (Qty Output in 1 minute)
A3 : Time required (Round up to the next higher minute)


Please advise, is my formula is correct and can you advise me how do I do
convert the result into hour and minutes as A3 show 1.82

A3 : roundup(A1/A2/60) = 1.82




"Rick Rothstein (MVP - VB)" wrote:

Assuming Row 1...

=IF(D1=0,0,E1/D1)

Rick


"TSK" wrote in message
...
Thank you Rick.

Can you advise the how to set the value to zero on the following
example

Example

Cell D - 0
Cell E - 0
Cell F - Reflect 0 instead of #DIV/0! when cell E/Cell D

"Rick Rothstein (MVP - VB)" wrote:

One way...

=MAX(0,(YEAR(B1)-YEAR(C1))*12+MONTH(B1)-MONTH(C1))

Rick


"TSK" wrote in message
...
Please advise

Q1: When applying the formula, D will show -38 but i need excel to
change
it
to zero and recongized it as number zero, otherwise when I multiple
other
cell with this cell it will give value - Example 1.

Q2: However, I would also need cell D1 to reflect the number if it
is
not
zero or negative number - Example 2

Example 1

A1 - 01 Mar 2001 (Start Date)
B1 - 01 Mar 2006 (End Date)
C1 - 31 May 2008 (Audit Date)
D1 - (YEAR(B1)-YEAR(C1))*12+MONTH(B1)-MONTH(C1) = 0 instead of -38


Example 2

A1 - 01 Mar 2001 (Start Date)
B1 - 01 Jun 2010 (End Date)
C1 - 31 May 2008 (Audit Date)
D1 - I had this formula in cell D1:
(YEAR(B1)-YEAR(C1))*12+MONTH(B1)-MONTH(C1) = 25








  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
TSK TSK is offline
external usenet poster
 
Posts: 21
Default How to calculate balance of hour and mintue

Thank David,

Base on your advise cell C now reflected as 1 hrs 49 mins and how do I
insert formula and allow cell D to reflect the balance hour (assuming 1 month
is 720 hours)

Manually calculation in cell D should reflected as 718:11

"David Biddulph" wrote:

Firstly, if you look in excel help for the ROUNDUP function, you'll see that
it needs a second argument, the number of digits.

Secondly, Excel times are in unit of one day, so you'll need to divide by 24
hours.

Try =ROUNDUP(A1/A2,0)/(60*24) and format as [h]:mm or whatever format suits
you.
--
David Biddulph

"TSK" wrote in message
...
Hi Rick,

Thank you very much. I had another question posted in the threat but there
is no replied. Perhaps can you tried to help me out too. The function I
need,
seem to be very much complicated to figure out by myself.

I need to calculate the time & power consumption A1 - A2 are data input,
A3
is result and I would liked to insert formula to do the calculation

A1 : 2,500 (Qty)
A2 : 23 (Qty Output in 1 minute)
A3 : Time required (Round up to the next higher minute)


Please advise, is my formula is correct and can you advise me how do I do
convert the result into hour and minutes as A3 show 1.82

A3 : roundup(A1/A2/60) = 1.82




"Rick Rothstein (MVP - VB)" wrote:

Assuming Row 1...

=IF(D1=0,0,E1/D1)

Rick


"TSK" wrote in message
...
Thank you Rick.

Can you advise the how to set the value to zero on the following
example

Example

Cell D - 0
Cell E - 0
Cell F - Reflect 0 instead of #DIV/0! when cell E/Cell D

"Rick Rothstein (MVP - VB)" wrote:

One way...

=MAX(0,(YEAR(B1)-YEAR(C1))*12+MONTH(B1)-MONTH(C1))

Rick


"TSK" wrote in message
...
Please advise

Q1: When applying the formula, D will show -38 but i need excel to
change
it
to zero and recongized it as number zero, otherwise when I multiple
other
cell with this cell it will give value - Example 1.

Q2: However, I would also need cell D1 to reflect the number if it
is
not
zero or negative number - Example 2

Example 1

A1 - 01 Mar 2001 (Start Date)
B1 - 01 Mar 2006 (End Date)
C1 - 31 May 2008 (Audit Date)
D1 - (YEAR(B1)-YEAR(C1))*12+MONTH(B1)-MONTH(C1) = 0 instead of -38


Example 2

A1 - 01 Mar 2001 (Start Date)
B1 - 01 Jun 2010 (End Date)
C1 - 31 May 2008 (Audit Date)
D1 - I had this formula in cell D1:
(YEAR(B1)-YEAR(C1))*12+MONTH(B1)-MONTH(C1) = 25









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
How to substract for lunch on =MOD function jcc31 Excel Worksheet Functions 4 March 9th 06 07:30 PM
How do I substract numbers in range like this: Substract(a1..a10) Paulo New Users to Excel 3 November 17th 05 04:48 AM
how do I substract kiserlouisa New Users to Excel 1 May 24th 05 12:55 AM
Can you substract dates? Steph in PA Excel Worksheet Functions 5 May 23rd 05 08:23 PM
how do i substract in microsoft excel? nards Excel Worksheet Functions 2 February 6th 05 11:29 PM


All times are GMT +1. The time now is 07:29 PM.

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"