Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
T
 
Posts: n/a
Default I need to get this answer 8 - 1.2 = 6.2 from a formula

where 8 is hours 1.2 = one hour 1/2 and 6.2 = six and a half

need the same for the following on the same spreadsheet
1.1 = 1.25 and 1.3 = 1.75
  #2   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

T,

With the 8 in cell A1, and the 1.2 in cell B1, the formula (watch it, 'cause
it'll be line wrapped)

=INT((INT(A1)+(A1-INT(A1))*2.5)-(INT(B1)+(B1-INT(B1))*2.5))+((INT(A1)+(A1-IN
T(A1))*2.5)-(INT(B1)+(B1-INT(B1))*2.5)-INT((INT(A1)+(A1-INT(A1))*2.5)-(INT(B
1)+(B1-INT(B1))*2.5)))/2.5

will return 6.2, and so on for all your examples.

HTH,
Bernie
MS Excel MVP

"T" wrote in message
...
where 8 is hours 1.2 = one hour 1/2 and 6.2 = six and a half

need the same for the following on the same spreadsheet
1.1 = 1.25 and 1.3 = 1.75



  #3   Report Post  
T
 
Posts: n/a
Default


That works!!! It took me a minute to figure out I needed to get rid of the
page breaks -- but man am I going to look good.... Thank you
"Bernie Deitrick" wrote:

T,

With the 8 in cell A1, and the 1.2 in cell B1, the formula (watch it, 'cause
it'll be line wrapped)

=INT((INT(A1)+(A1-INT(A1))*2.5)-(INT(B1)+(B1-INT(B1))*2.5))+((INT(A1)+(A1-IN
T(A1))*2.5)-(INT(B1)+(B1-INT(B1))*2.5)-INT((INT(A1)+(A1-INT(A1))*2.5)-(INT(B
1)+(B1-INT(B1))*2.5)))/2.5

will return 6.2, and so on for all your examples.

HTH,
Bernie
MS Excel MVP

"T" wrote in message
...
where 8 is hours 1.2 = one hour 1/2 and 6.2 = six and a half

need the same for the following on the same spreadsheet
1.1 = 1.25 and 1.3 = 1.75




  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default

.... but of course, you will tell everyone that is was Bernie who solved it?

Bob

"T" wrote in message
...

That works!!! It took me a minute to figure out I needed to get rid of

the
page breaks -- but man am I going to look good.... Thank you
"Bernie Deitrick" wrote:

T,

With the 8 in cell A1, and the 1.2 in cell B1, the formula (watch it,

'cause
it'll be line wrapped)


=INT((INT(A1)+(A1-INT(A1))*2.5)-(INT(B1)+(B1-INT(B1))*2.5))+((INT(A1)+(A1-IN

T(A1))*2.5)-(INT(B1)+(B1-INT(B1))*2.5)-INT((INT(A1)+(A1-INT(A1))*2.5)-(INT(B
1)+(B1-INT(B1))*2.5)))/2.5

will return 6.2, and so on for all your examples.

HTH,
Bernie
MS Excel MVP

"T" wrote in message
...
where 8 is hours 1.2 = one hour 1/2 and 6.2 = six and a

half

need the same for the following on the same spreadsheet
1.1 = 1.25 and 1.3 = 1.75






  #5   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

Actually, I prefer Tim C's solution, so let's keep my name out of this, OK?
;-)

Bernie

"Bob Phillips" wrote in message
...
... but of course, you will tell everyone that is was Bernie who solved

it?

Bob

"T" wrote in message
...

That works!!! It took me a minute to figure out I needed to get rid of

the
page breaks -- but man am I going to look good.... Thank you





  #6   Report Post  
 
Posts: n/a
Default

Bernie Deitrick wrote...
With the 8 in cell A1, and the 1.2 in cell B1, the formula (watch it,

'cause
it'll be line wrapped)

=INT((INT(A1)+(A1-INT(A1))*2.5)-(INT(B1)+(B1-INT(B1))*2.5))
+((INT(A1)+(A1-INT(A1))*2.5)-(INT(B1)+(B1-INT(B1))*2.5)
-INT((INT(A1)+(A1-INT(A1))*2.5)-(INT(B1)+(B1-INT(B1))*2.5)))/2.5

will return 6.2, and so on for all your examples.

....

Can give noncompliant results when A1 < B1. Also could be shortened.

=SIGN(A1-B1)*(INT(MAX(A1,B1)-MIN(A1,B1))
+MOD(2.5*(MOD(MAX(A1,B1),1)-MOD(MIN(A1,B1),1)),1)/2.5)

  #7   Report Post  
Tim C
 
Posts: n/a
Default

One way:
=A1-B1-0.6*((MOD(B1,1)-MOD(A1,1))0.01)

Tim C

"T" wrote in message
...
where 8 is hours 1.2 = one hour 1/2 and 6.2 = six and a half

need the same for the following on the same spreadsheet
1.1 = 1.25 and 1.3 = 1.75



  #8   Report Post  
Tim C
 
Posts: n/a
Default

Isn't there or didn't there used to be a function that gives you the decimal
portion of a number (the equivalent of MOD(x,1))?

Or am I having flashbacks to old programming languages?

MOD doesn't do a very clean job. I wish I could to something like:

=A1-B1-0.6*(DEC(B1)DEC(A1))

Tim C


"Tim C" wrote in message
...
One way:
=A1-B1-0.6*((MOD(B1,1)-MOD(A1,1))0.01)

Tim C

"T" wrote in message
...
where 8 is hours 1.2 = one hour 1/2 and 6.2 = six and a half

need the same for the following on the same spreadsheet
1.1 = 1.25 and 1.3 = 1.75



  #9   Report Post  
RagDyer
 
Posts: n/a
Default

For decimals, are you perhaps talking about:
=A1-INT(A1)
--


Regards,

RD
--------------------------------------------------------------------
Please keep all correspondence within the Group, so all may benefit!
-------------------------------------------------------------------

"Tim C" wrote in message
...
Isn't there or didn't there used to be a function that gives you the decimal
portion of a number (the equivalent of MOD(x,1))?

Or am I having flashbacks to old programming languages?

MOD doesn't do a very clean job. I wish I could to something like:

=A1-B1-0.6*(DEC(B1)DEC(A1))

Tim C


"Tim C" wrote in message
...
One way:
=A1-B1-0.6*((MOD(B1,1)-MOD(A1,1))0.01)

Tim C

"T" wrote in message
...
where 8 is hours 1.2 = one hour 1/2 and 6.2 = six and a half

need the same for the following on the same spreadsheet
1.1 = 1.25 and 1.3 = 1.75



  #10   Report Post  
Tim C
 
Posts: n/a
Default

I'm sure I could come up with a dozen different formulas to do it. But I
distinctly remember a function that did it. But it may not have been in
Excel.

Tim C

"RagDyer" wrote in message
...

For decimals, are you perhaps talking about:
=A1-INT(A1)
--

Regards,

RD

"Tim C" wrote in message
...


Isn't there or didn't there used to be a function that gives you the
decimal
portion of a number (the equivalent of MOD(x,1))?

Or am I having flashbacks to old programming languages?

MOD doesn't do a very clean job. I wish I could to something like:

=A1-B1-0.6*(DEC(B1)DEC(A1))

Tim C

"Tim C" wrote in message
...


One way:
=A1-B1-0.6*((MOD(B1,1)-MOD(A1,1))0.01)

Tim C

"T" wrote in message
...
where 8 is hours 1.2 = one hour 1/2 and 6.2 = six and a half

need the same for the following on the same spreadsheet
1.1 = 1.25 and 1.3 = 1.75





  #11   Report Post  
T
 
Posts: n/a
Default

INT(INT(A1)+MOD(A1,1)*2.5+INT(B1)+MOD(B1,1)*2.5-(INT(C1)+MOD(C1,1)*2.5))+(MOD(INT(A1)+MOD(A1,1)*2. 5+INT(B1)+MOD(B1,1)*2.5-(INT(C1)+MOD(C1,1)*2.5),1)*0.4)

We've gotten this far -- now --can someone have this read negative numbers
as well?
"T" wrote:

where 8 is hours 1.2 = one hour 1/2 and 6.2 = six and a half

need the same for the following on the same spreadsheet
1.1 = 1.25 and 1.3 = 1.75

  #12   Report Post  
T
 
Posts: n/a
Default


thanks
"T" wrote:

INT(INT(A1)+MOD(A1,1)*2.5+INT(B1)+MOD(B1,1)*2.5-(INT(C1)+MOD(C1,1)*2.5))+(MOD(INT(A1)+MOD(A1,1)*2. 5+INT(B1)+MOD(B1,1)*2.5-(INT(C1)+MOD(C1,1)*2.5),1)*0.4)

We've gotten this far -- now --can someone have this read negative numbers
as well?
"T" wrote:

where 8 is hours 1.2 = one hour 1/2 and 6.2 = six and a half

need the same for the following on the same spreadsheet
1.1 = 1.25 and 1.3 = 1.75

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
Display answer only in another cell of one containing a formula Mally Excel Discussion (Misc queries) 5 January 21st 05 01:07 PM
How do I calculate a formula with a not-to-exceed answer? danfromthelake Excel Discussion (Misc queries) 1 January 19th 05 01:57 AM
how can i create a formula or format the cells so the answer is a. jenniss Excel Discussion (Misc queries) 5 January 6th 05 04:50 PM
display the answer for a formula from another page? Lou New Users to Excel 2 November 29th 04 12:17 AM
Formula window displays correct answer while cell displays incorre MMV Excel Worksheet Functions 3 November 10th 04 09:28 PM


All times are GMT +1. The time now is 06:47 AM.

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

About Us

"It's about Microsoft Excel"