+ Reply to Thread
Results 1 to 17 of 17

a function on decimals-last two digits

  1. #1
    Barb Reinhardt
    Guest

    a function on decimals-last two digits

    Try

    =ROUND((A1*100000)/25,0)*25/100000


    "chartasap" <[email protected]> wrote in message
    news:[email protected]...
    > Hello,
    >
    > would someone be able to help me build a function that would take the last
    > two digits in a value compare it then return a '0' or '5'. For example,
    >
    > Column A
    > 1.53138 (this value is the result of a formula =sum(c6/5873.05-c3) -->

    take
    > last two digits '38' compared to .00025. If it's less than .00025 then

    those
    > two last digits should become a 0 if greater than .00025 then it should be
    > '5'.
    > RESULT
    > 1.5315
    > ---------
    > 1.53047 --> 1.5305
    > 1.53002 --> 1.5300
    > 1.52957 --> 1.5295
    >
    > Thank you!
    >




  2. #2
    Bernie Deitrick
    Guest

    re: a function on decimals-last two digits

    Because it is rounding to the nearest .00025, not as per your actual criteria.

    HTH,
    Bernie
    MS Excel MVP


    > It works great however, when i used the function below for values such as
    > 1.52866, 1.52821, 1.52775, 1.52730 etc. the result is not correct. Any idea
    > why it won't work on these?




  3. #3
    chartasap
    Guest

    re: a function on decimals-last two digits

    Thank you Duke...this is definitely another way i can go.

    "Duke Carey" wrote:

    > One more alternative
    >
    > =TRUNC(A1,3)+0.0005*(MID(A1,SEARCH(".",A1)+4,2)>25)
    >
    > "chartasap" wrote:
    >
    > > Hello,
    > >
    > > would someone be able to help me build a function that would take the last
    > > two digits in a value compare it then return a '0' or '5'. For example,
    > >
    > > Column A
    > > 1.53138 (this value is the result of a formula =sum(c6/5873.05-c3) --> take
    > > last two digits '38' compared to .00025. If it's less than .00025 then those
    > > two last digits should become a 0 if greater than .00025 then it should be
    > > '5'.
    > > RESULT
    > > 1.5315
    > > ---------
    > > 1.53047 --> 1.5305
    > > 1.53002 --> 1.5300
    > > 1.52957 --> 1.5295
    > >
    > > Thank you!
    > >


  4. #4
    chartasap
    Guest

    re: a function on decimals-last two digits

    Thank you Bernie...i tried this formula and it works wonderfully. Thank you
    for your time.

    "Bernie Deitrick" wrote:

    > For a value in cell A1:
    >
    > =IF(A1*1000-INT(A1*1000)>=0.25,INT(A1*1000)/1000+0.0005,INT(A1*1000)/1000)
    >
    > You didn't say what to do it it were equal to 25, so I chose >=, but you can change that.
    >
    > HTH,
    > Bernie
    > MS Excel MVP
    >
    >
    > "chartasap" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hello,
    > >
    > > would someone be able to help me build a function that would take the last
    > > two digits in a value compare it then return a '0' or '5'. For example,
    > >
    > > Column A
    > > 1.53138 (this value is the result of a formula =sum(c6/5873.05-c3) --> take
    > > last two digits '38' compared to .00025. If it's less than .00025 then those
    > > two last digits should become a 0 if greater than .00025 then it should be
    > > '5'.
    > > RESULT
    > > 1.5315
    > > ---------
    > > 1.53047 --> 1.5305
    > > 1.53002 --> 1.5300
    > > 1.52957 --> 1.5295
    > >
    > > Thank you!
    > >

    >
    >
    >


  5. #5
    chartasap
    Guest

    re: a function on decimals-last two digits

    Barb,

    It works great however, when i used the function below for values such as
    1.52866, 1.52821, 1.52775, 1.52730 etc. the result is not correct. Any idea
    why it won't work on these?

    "Barb Reinhardt" wrote:

    > Try
    >
    > =ROUND((A1*100000)/25,0)*25/100000
    >
    >
    > "chartasap" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hello,
    > >
    > > would someone be able to help me build a function that would take the last
    > > two digits in a value compare it then return a '0' or '5'. For example,
    > >
    > > Column A
    > > 1.53138 (this value is the result of a formula =sum(c6/5873.05-c3) -->

    > take
    > > last two digits '38' compared to .00025. If it's less than .00025 then

    > those
    > > two last digits should become a 0 if greater than .00025 then it should be
    > > '5'.
    > > RESULT
    > > 1.5315
    > > ---------
    > > 1.53047 --> 1.5305
    > > 1.53002 --> 1.5300
    > > 1.52957 --> 1.5295
    > >
    > > Thank you!
    > >

    >
    >
    >


  6. #6
    Duke Carey
    Guest

    re: a function on decimals-last two digits

    Oops - make that

    =TRUNC(A1,3)+0.0005*(VALUE(MID(A1,SEARCH(".",A1)+4,2))>25)

    "chartasap" wrote:

    > Hello,
    >
    > would someone be able to help me build a function that would take the last
    > two digits in a value compare it then return a '0' or '5'. For example,
    >
    > Column A
    > 1.53138 (this value is the result of a formula =sum(c6/5873.05-c3) --> take
    > last two digits '38' compared to .00025. If it's less than .00025 then those
    > two last digits should become a 0 if greater than .00025 then it should be
    > '5'.
    > RESULT
    > 1.5315
    > ---------
    > 1.53047 --> 1.5305
    > 1.53002 --> 1.5300
    > 1.52957 --> 1.5295
    >
    > Thank you!
    >


  7. #7
    Duke Carey
    Guest

    re: a function on decimals-last two digits

    One more alternative

    =TRUNC(A1,3)+0.0005*(MID(A1,SEARCH(".",A1)+4,2)>25)

    "chartasap" wrote:

    > Hello,
    >
    > would someone be able to help me build a function that would take the last
    > two digits in a value compare it then return a '0' or '5'. For example,
    >
    > Column A
    > 1.53138 (this value is the result of a formula =sum(c6/5873.05-c3) --> take
    > last two digits '38' compared to .00025. If it's less than .00025 then those
    > two last digits should become a 0 if greater than .00025 then it should be
    > '5'.
    > RESULT
    > 1.5315
    > ---------
    > 1.53047 --> 1.5305
    > 1.53002 --> 1.5300
    > 1.52957 --> 1.5295
    >
    > Thank you!
    >


  8. #8
    Bernie Deitrick
    Guest

    re: a function on decimals-last two digits

    For a value in cell A1:

    =IF(A1*1000-INT(A1*1000)>=0.25,INT(A1*1000)/1000+0.0005,INT(A1*1000)/1000)

    You didn't say what to do it it were equal to 25, so I chose >=, but you can change that.

    HTH,
    Bernie
    MS Excel MVP


    "chartasap" <[email protected]> wrote in message
    news:[email protected]...
    > Hello,
    >
    > would someone be able to help me build a function that would take the last
    > two digits in a value compare it then return a '0' or '5'. For example,
    >
    > Column A
    > 1.53138 (this value is the result of a formula =sum(c6/5873.05-c3) --> take
    > last two digits '38' compared to .00025. If it's less than .00025 then those
    > two last digits should become a 0 if greater than .00025 then it should be
    > '5'.
    > RESULT
    > 1.5315
    > ---------
    > 1.53047 --> 1.5305
    > 1.53002 --> 1.5300
    > 1.52957 --> 1.5295
    >
    > Thank you!
    >




  9. #9
    Duke Carey
    Guest

    re: a function on decimals-last two digits

    One more alternative

    =TRUNC(A1,3)+0.0005*(MID(A1,SEARCH(".",A1)+4,2)>25)

    "chartasap" wrote:

    > Hello,
    >
    > would someone be able to help me build a function that would take the last
    > two digits in a value compare it then return a '0' or '5'. For example,
    >
    > Column A
    > 1.53138 (this value is the result of a formula =sum(c6/5873.05-c3) --> take
    > last two digits '38' compared to .00025. If it's less than .00025 then those
    > two last digits should become a 0 if greater than .00025 then it should be
    > '5'.
    > RESULT
    > 1.5315
    > ---------
    > 1.53047 --> 1.5305
    > 1.53002 --> 1.5300
    > 1.52957 --> 1.5295
    >
    > Thank you!
    >


  10. #10
    Duke Carey
    Guest

    re: a function on decimals-last two digits

    Oops - make that

    =TRUNC(A1,3)+0.0005*(VALUE(MID(A1,SEARCH(".",A1)+4,2))>25)

    "chartasap" wrote:

    > Hello,
    >
    > would someone be able to help me build a function that would take the last
    > two digits in a value compare it then return a '0' or '5'. For example,
    >
    > Column A
    > 1.53138 (this value is the result of a formula =sum(c6/5873.05-c3) --> take
    > last two digits '38' compared to .00025. If it's less than .00025 then those
    > two last digits should become a 0 if greater than .00025 then it should be
    > '5'.
    > RESULT
    > 1.5315
    > ---------
    > 1.53047 --> 1.5305
    > 1.53002 --> 1.5300
    > 1.52957 --> 1.5295
    >
    > Thank you!
    >


  11. #11
    chartasap
    Guest

    re: a function on decimals-last two digits

    Barb,

    It works great however, when i used the function below for values such as
    1.52866, 1.52821, 1.52775, 1.52730 etc. the result is not correct. Any idea
    why it won't work on these?

    "Barb Reinhardt" wrote:

    > Try
    >
    > =ROUND((A1*100000)/25,0)*25/100000
    >
    >
    > "chartasap" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hello,
    > >
    > > would someone be able to help me build a function that would take the last
    > > two digits in a value compare it then return a '0' or '5'. For example,
    > >
    > > Column A
    > > 1.53138 (this value is the result of a formula =sum(c6/5873.05-c3) -->

    > take
    > > last two digits '38' compared to .00025. If it's less than .00025 then

    > those
    > > two last digits should become a 0 if greater than .00025 then it should be
    > > '5'.
    > > RESULT
    > > 1.5315
    > > ---------
    > > 1.53047 --> 1.5305
    > > 1.53002 --> 1.5300
    > > 1.52957 --> 1.5295
    > >
    > > Thank you!
    > >

    >
    >
    >


  12. #12
    Bernie Deitrick
    Guest

    re: a function on decimals-last two digits

    For a value in cell A1:

    =IF(A1*1000-INT(A1*1000)>=0.25,INT(A1*1000)/1000+0.0005,INT(A1*1000)/1000)

    You didn't say what to do it it were equal to 25, so I chose >=, but you can change that.

    HTH,
    Bernie
    MS Excel MVP


    "chartasap" <[email protected]> wrote in message
    news:[email protected]...
    > Hello,
    >
    > would someone be able to help me build a function that would take the last
    > two digits in a value compare it then return a '0' or '5'. For example,
    >
    > Column A
    > 1.53138 (this value is the result of a formula =sum(c6/5873.05-c3) --> take
    > last two digits '38' compared to .00025. If it's less than .00025 then those
    > two last digits should become a 0 if greater than .00025 then it should be
    > '5'.
    > RESULT
    > 1.5315
    > ---------
    > 1.53047 --> 1.5305
    > 1.53002 --> 1.5300
    > 1.52957 --> 1.5295
    >
    > Thank you!
    >




  13. #13
    chartasap
    Guest

    re: a function on decimals-last two digits

    Thank you Bernie...i tried this formula and it works wonderfully. Thank you
    for your time.

    "Bernie Deitrick" wrote:

    > For a value in cell A1:
    >
    > =IF(A1*1000-INT(A1*1000)>=0.25,INT(A1*1000)/1000+0.0005,INT(A1*1000)/1000)
    >
    > You didn't say what to do it it were equal to 25, so I chose >=, but you can change that.
    >
    > HTH,
    > Bernie
    > MS Excel MVP
    >
    >
    > "chartasap" <[email protected]> wrote in message
    > news:[email protected]...
    > > Hello,
    > >
    > > would someone be able to help me build a function that would take the last
    > > two digits in a value compare it then return a '0' or '5'. For example,
    > >
    > > Column A
    > > 1.53138 (this value is the result of a formula =sum(c6/5873.05-c3) --> take
    > > last two digits '38' compared to .00025. If it's less than .00025 then those
    > > two last digits should become a 0 if greater than .00025 then it should be
    > > '5'.
    > > RESULT
    > > 1.5315
    > > ---------
    > > 1.53047 --> 1.5305
    > > 1.53002 --> 1.5300
    > > 1.52957 --> 1.5295
    > >
    > > Thank you!
    > >

    >
    >
    >


  14. #14
    chartasap
    Guest

    re: a function on decimals-last two digits

    Thank you Duke...this is definitely another way i can go.

    "Duke Carey" wrote:

    > One more alternative
    >
    > =TRUNC(A1,3)+0.0005*(MID(A1,SEARCH(".",A1)+4,2)>25)
    >
    > "chartasap" wrote:
    >
    > > Hello,
    > >
    > > would someone be able to help me build a function that would take the last
    > > two digits in a value compare it then return a '0' or '5'. For example,
    > >
    > > Column A
    > > 1.53138 (this value is the result of a formula =sum(c6/5873.05-c3) --> take
    > > last two digits '38' compared to .00025. If it's less than .00025 then those
    > > two last digits should become a 0 if greater than .00025 then it should be
    > > '5'.
    > > RESULT
    > > 1.5315
    > > ---------
    > > 1.53047 --> 1.5305
    > > 1.53002 --> 1.5300
    > > 1.52957 --> 1.5295
    > >
    > > Thank you!
    > >


  15. #15
    Barb Reinhardt
    Guest

    re: a function on decimals-last two digits

    Try

    =ROUND((A1*100000)/25,0)*25/100000


    "chartasap" <[email protected]> wrote in message
    news:[email protected]...
    > Hello,
    >
    > would someone be able to help me build a function that would take the last
    > two digits in a value compare it then return a '0' or '5'. For example,
    >
    > Column A
    > 1.53138 (this value is the result of a formula =sum(c6/5873.05-c3) -->

    take
    > last two digits '38' compared to .00025. If it's less than .00025 then

    those
    > two last digits should become a 0 if greater than .00025 then it should be
    > '5'.
    > RESULT
    > 1.5315
    > ---------
    > 1.53047 --> 1.5305
    > 1.53002 --> 1.5300
    > 1.52957 --> 1.5295
    >
    > Thank you!
    >




  16. #16
    Bernie Deitrick
    Guest

    re: a function on decimals-last two digits

    Because it is rounding to the nearest .00025, not as per your actual criteria.

    HTH,
    Bernie
    MS Excel MVP


    > It works great however, when i used the function below for values such as
    > 1.52866, 1.52821, 1.52775, 1.52730 etc. the result is not correct. Any idea
    > why it won't work on these?




  17. #17
    chartasap
    Guest

    a function on decimals

    Hello,

    would someone be able to help me build a function that would take the last
    two digits in a value compare it then return a '0' or '5'. For example,

    Column A
    1.53138 (this value is the result of a formula =sum(c6/5873.05-c3) --> take
    last two digits '38' compared to .00025. If it's less than .00025 then those
    two last digits should become a 0 if greater than .00025 then it should be
    '5'.
    RESULT
    1.5315
    ---------
    1.53047 --> 1.5305
    1.53002 --> 1.5300
    1.52957 --> 1.5295

    Thank you!


+ 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