Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Absolute value

I have a sub that checks if the contents of cells in two rows are the same.
The cells contain numbers that are paset from another program. If they are
not the same I want to see how big the absolute difference is between the two
cells. I do not know how to write the difference in absoulte terms, so I need
help with that. My code is:
If rng4.Offset(l, 0) < 0 And rng3.Offset(l, 0) Then
dblLocalReturnDiff = rng4.Offset(l, 0) - rng3.Offset(l, 0)
If dblLocalReutrnDiff errorMarginal Then...
It is on the last row that I am interesetd in using the absoulte value for
the difference. Please help me!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Absolute value

Hi Sally,

Try:

dblLocalReturnDiff = Abs(Abs(rng4.Offset(l, 0)) _
- Abs(rng3.Offset(l,
0)))

---
Regards,
Norman



"Sally Mae" wrote in message
...
I have a sub that checks if the contents of cells in two rows are the same.
The cells contain numbers that are paset from another program. If they are
not the same I want to see how big the absolute difference is between the
two
cells. I do not know how to write the difference in absoulte terms, so I
need
help with that. My code is:
If rng4.Offset(l, 0) < 0 And rng3.Offset(l, 0) Then
dblLocalReturnDiff = rng4.Offset(l, 0) - rng3.Offset(l, 0)
If dblLocalReutrnDiff errorMarginal Then...
It is on the last row that I am interesetd in using the absoulte value for
the difference. Please help me!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Absolute value

If ABS(dblLocalReturnDiff ) errorMarginal Then...
!
Regards,
Stefi

€˛Sally Mae€¯ ezt Ć*rta:

I have a sub that checks if the contents of cells in two rows are the same.
The cells contain numbers that are paset from another program. If they are
not the same I want to see how big the absolute difference is between the two
cells. I do not know how to write the difference in absoulte terms, so I need
help with that. My code is:
If rng4.Offset(l, 0) < 0 And rng3.Offset(l, 0) Then
dblLocalReturnDiff = rng4.Offset(l, 0) - rng3.Offset(l, 0)
If dblLocalReutrnDiff errorMarginal Then...
It is on the last row that I am interesetd in using the absoulte value for
the difference. Please help me!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Absolute value

Hi Sally.

Another interpretation of your question would be:

dblLocalReturnDiff = Abs(rng4.Offset(l, 0) - rng3.Offset(l, 0))


The first suggestion returns the absolute value of the difference of the
absolute cell values; the latter expression returns the absolute value of
the difference of cell values.


---
Regards,
Norman


"Norman Jones" wrote in message
...
Hi Sally,

Try:

dblLocalReturnDiff = Abs(Abs(rng4.Offset(l, 0)) _
- Abs(rng3.Offset(l,
0)))

---
Regards,
Norman



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
Absolute cell reference will not remain absolute. Mike K Excel Worksheet Functions 1 October 8th 08 07:12 PM
Absolute Value EG Excel Worksheet Functions 2 September 28th 06 02:29 PM
absolute value EG Excel Worksheet Functions 3 September 22nd 06 07:41 PM
How can I do an Absolute Cell Reference but non Absolute Cell Pais John Excel Programming 1 July 22nd 05 07:28 PM
How can I do an Absolute Cell Reference but non Absolute Cell Pais John Excel Programming 0 July 22nd 05 06:23 PM


All times are GMT +1. The time now is 08:36 PM.

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"