+ Reply to Thread
Results 1 to 4 of 4

Absolute value

  1. #1
    Sally Mae
    Guest

    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. #2
    Norman Jones
    Guest

    Re: Absolute value

    Hi Sally,

    Try:

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

    ---
    Regards,
    Norman



    "Sally Mae" <[email protected]> wrote in message
    news:[email protected]...
    >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. #3
    Stefi
    Guest

    RE: 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. #4
    Norman Jones
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > Hi Sally,
    >
    > Try:
    >
    > dblLocalReturnDiff = Abs(Abs(rng4.Offset(l, 0)) _
    > - Abs(rng3.Offset(l,
    > 0)))
    >
    > ---
    > Regards,
    > Norman




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1