Results 1 to 19 of 19
  1. #1
    Thailand Expat

    Join Date
    Feb 2009
    Last Online
    04-11-2019 @ 05:15 AM
    Posts
    3,857

    My Integer lacks integrity

    I have a number of say 3. I turn it into an integer, and hey voila!, I have a 2.

    Sounds familiar? Then please share.


    Excel macro puts a number into a field. It adds 0.4 every time.

    Range("Variables!G" & y) = Range("Variables!G" & y) + Range("Variables!B9")

    B9 = 0.4
    It starts off with 1



    Then that number is placed into another field as an integer.

    Range("F" & y) = Int(Range("Variables!G" & y).Value)

    All works well till the source number is a whole number.
    2.4 gives me 2 etc.

    But if its a, say, 3 then it returns a fuckin 2.

    Makes no difference if range G is formatted as numbers or general.

    However, if I manually type a 3 into the range G field, it returns a 3

    Source is not 2.99999 or anything



    WTF??


    Any ideas?

  2. #2
    Thailand Expat

    Join Date
    Feb 2009
    Last Online
    04-11-2019 @ 05:15 AM
    Posts
    3,857
    BTW, this is computer NEWS....


    NEWS shit seems to be Holy shit around here. I tread with trepidation.

    I cannot find a closer slot to drop it in. So sue me.

  3. #3
    Thailand Expat

    Join Date
    Feb 2009
    Last Online
    04-11-2019 @ 05:15 AM
    Posts
    3,857
    Hey! Anyone around??

    Do I need to send a messenger with a cleft stick??

    Geez.

  4. #4
    Thailand Expat

    Join Date
    Feb 2009
    Last Online
    04-11-2019 @ 05:15 AM
    Posts
    3,857
    HELLOOOOOoooooo......

  5. #5
    Thailand Expat harrybarracuda's Avatar
    Join Date
    Sep 2009
    Last Online
    @
    Posts
    103,007
    What version of Excel?

  6. #6
    Thailand Expat

    Join Date
    Feb 2009
    Last Online
    04-11-2019 @ 05:15 AM
    Posts
    3,857
    Yay!

    Office PP 2010

    This is driving me fuckin nuts.


    I suppose instead of 0.4 increments I could make it 0.400000001 increments. But that should not be.
    Last edited by FlyFree; 30-07-2012 at 04:48 PM.

  7. #7
    Thailand Expat harrybarracuda's Avatar
    Join Date
    Sep 2009
    Last Online
    @
    Posts
    103,007
    Hey don't think I'm an Excel expert, just because I answered. I have people for that.



    Are all the calculations within one sheet?

  8. #8
    Thailand Expat

    Join Date
    Feb 2009
    Last Online
    04-11-2019 @ 05:15 AM
    Posts
    3,857
    Yes. The result goes to another sheet. But i sent it to the same sheet with the same result. Eh?

  9. #9
    Thailand Expat harrybarracuda's Avatar
    Join Date
    Sep 2009
    Last Online
    @
    Posts
    103,007
    And does this help?

    Excel 2010
    1. Click on the File tab, click Excel Options, and then click Advanced category.
    2. In the When calculating this workbook section, select the workbook that you want, click to select the Set precision as displayed check box, and then click OK.
    If you use the Precision as displayed option, you must format your numbers by using a specific number format.

    To format cells to a specific number precision, follow these steps:
    1. Right-click the cells that you want to format, and then click Format Cells.
    2. On the Number tab, under Category, click Number.
    3. In the Decimal places box, select the precision (number of decimal places) that you want.
    4. Click OK.

  10. #10
    Thailand Expat

    Join Date
    Feb 2009
    Last Online
    04-11-2019 @ 05:15 AM
    Posts
    3,857
    Done dat. Doesn't make any diff.

    The whole thing don't make sense. Either it's one of those times when you fail to see the fuckin elephant in front of you, or it's something related to how the hardware/software combo fucks something up. I thought those days are gone.


    I'll turn the increment into 0.40000000001, but I don't like these things.

  11. #11
    I'm in Jail
    Butterfly's Avatar
    Join Date
    Mar 2006
    Last Online
    12-06-2021 @ 11:13 PM
    Posts
    39,832
    Quote Originally Posted by FlyFree View Post
    I have a number of say 3. I turn it into an integer, and hey voila!, I have a 2.

    Sounds familiar? Then please share.


    Excel macro puts a number into a field. It adds 0.4 every time.

    Range("Variables!G" & y) = Range("Variables!G" & y) + Range("Variables!B9")

    B9 = 0.4
    It starts off with 1



    Then that number is placed into another field as an integer.

    Range("F" & y) = Int(Range("Variables!G" & y).Value)

    All works well till the source number is a whole number.
    2.4 gives me 2 etc.

    But if its a, say, 3 then it returns a fuckin 2.

    Makes no difference if range G is formatted as numbers or general.

    However, if I manually type a 3 into the range G field, it returns a 3

    Source is not 2.99999 or anything



    WTF??


    Any ideas?
    programming is not your strong, isn't it ?

    what are you trying to do so we can correct your mistakes,

  12. #12
    Thailand Expat

    Join Date
    Feb 2009
    Last Online
    04-11-2019 @ 05:15 AM
    Posts
    3,857
    I lie. I formatted the cells, but not set precision as displayed.

    It warns me that data will permanently lose accuracy. I'll have to give it a moments thought before i do.

    Will get back later. Thanks.

  13. #13
    Thailand Expat

    Join Date
    Feb 2009
    Last Online
    04-11-2019 @ 05:15 AM
    Posts
    3,857
    Quote Originally Posted by Butterfly View Post
    Quote Originally Posted by FlyFree View Post
    I have a number of say 3. I turn it into an integer, and hey voila!, I have a 2.

    Sounds familiar? Then please share.


    Excel macro puts a number into a field. It adds 0.4 every time.

    Range("Variables!G" & y) = Range("Variables!G" & y) + Range("Variables!B9")

    B9 = 0.4
    It starts off with 1



    Then that number is placed into another field as an integer.

    Range("F" & y) = Int(Range("Variables!G" & y).Value)

    All works well till the source number is a whole number.
    2.4 gives me 2 etc.

    But if its a, say, 3 then it returns a fuckin 2.

    Makes no difference if range G is formatted as numbers or general.

    However, if I manually type a 3 into the range G field, it returns a 3

    Source is not 2.99999 or anything



    WTF??


    Any ideas?
    programming is not your strong, isn't it ?

    what are you trying to do so we can correct your mistakes,
    No. Psychology is. And sex. And you're nuts. Not your nuts.

    Though I've done a fair bit of programming.

    I'm trying to turn a number like 1.8 into an integer.

    Reading is not your strong point is it?

  14. #14
    I'm in Jail
    Butterfly's Avatar
    Join Date
    Mar 2006
    Last Online
    12-06-2021 @ 11:13 PM
    Posts
    39,832
    Quote Originally Posted by FlyFree
    I'm trying to turn a number like 1.8 into an integer.
    not from those lines above, you are trying to "program" cells instead of running cells with functions,

    so the question remains: what are you trying to do ? the techniques for turning a floating into integer takes about 1 line, so not sure what you are trying to do above ? playing amateurish maybe ?

  15. #15
    Thailand Expat
    Mid's Avatar
    Join Date
    Aug 2007
    Last Online
    @
    Posts
    1,411
    Butter buts strong point is trolling , thought everyone knows that .

  16. #16
    I'm in Jail
    Butterfly's Avatar
    Join Date
    Mar 2006
    Last Online
    12-06-2021 @ 11:13 PM
    Posts
    39,832
    ^ go back to sleep retard, at least you are more useful

  17. #17
    Thailand Expat harrybarracuda's Avatar
    Join Date
    Sep 2009
    Last Online
    @
    Posts
    103,007
    Well forget getting a sensible solution to your problem if Buttplug is offering you computing advice. He'll probably give you a registry edit to apply.


  18. #18
    I'm in Jail
    Butterfly's Avatar
    Join Date
    Mar 2006
    Last Online
    12-06-2021 @ 11:13 PM
    Posts
    39,832
    of course you could download a new kernel and root your Excel installation with a special blend

    making you an expert in Excel like harry is in Android and other mobile computing devices,

  19. #19
    Thailand Expat harrybarracuda's Avatar
    Join Date
    Sep 2009
    Last Online
    @
    Posts
    103,007
    Go away Buttplug, let the grown ups talk among themselves, you retard.

    Is there any thread on TD to which you contribute anything useful?

    Rhetorical question.

Thread Information

Users Browsing this Thread

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

Posting Permissions

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