#1
|
||||
|
||||
Custom SUM functions are ignoring or rounding up decimals
Hi folks
I have a handful of customised "SUM" functions in my spreadsheet, e.g. SUMSUB, SUMCAT, which calculate the values of cells with specific style names in a column. Today I noticed that these functions are either ignoring the decimal places or rounding them up to the nearest full number. Example: 0.50 and below is treated as "0", whereas 0.51 and above is treated as "1". (Any formulas which use the default "SUM" are working correctly.) Quote:
|
#2
|
|||
|
|||
I think the Long Data type is for whole numbers only, try variant or double
|
#3
|
||||
|
||||
Thanks, Purfleet. Would you mind posting an example of the code line I need to add/amend? I'm still feeling my way through this area of VBA programming.
|
#4
|
|||
|
|||
This row
Dim xSum As Long Change to variant |
#5
|
||||
|
||||
That works. Many thanks.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Ignoring #VALUE in formula calculations | NickFazer | Excel | 7 | 11-09-2018 03:26 PM |
Custom rounding up | paulkaye | Excel | 8 | 09-03-2016 11:12 PM |
Need to restore custom functions from a corrupt ".xlam" file ... | gamouning | Excel | 1 | 11-12-2015 11:03 AM |
Custom formatting code - rounding problem | venkys4u | Excel | 1 | 08-14-2012 07:45 PM |
Merge Field Ignoring Zeros | Welshie82 | Mail Merge | 2 | 05-04-2012 01:56 AM |