• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Group By - Unable to SUM Zeros|Power Query|Excel Forum|My Online Training Hub

You are here: Home / Group By - Unable to SUM Zeros|Power Query|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumPower QueryGroup By - Unable to SUM Zeros
sp_PrintTopic sp_TopicIcon
Group By - Unable to SUM Zeros
Avatar
Adam Smith
Member
Members
Level 0
Forum Posts: 45
Member Since:
December 18, 2018
sp_UserOfflineSmall Offline
1
July 10, 2020 - 10:34 pm
sp_Permalink sp_Print

Hello there, I'm encountering an error that doesn't make any sense to me. I have three columns. I'm trying to Group by the first two and SUM the third. The third column is decimal numbers, however when I SUM them, all the zeros are returned as errors.

I've tried some things like changing the number column to different types prior to grouping, but nothing seems to be working. Is this correct behaviour? Should I just replace the errors with zeros?

 

Thanks for your help

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4443
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
2
July 11, 2020 - 9:08 am
sp_Permalink sp_Print

Hi Adam,

It should simply return a group with zero total. Do the zeros show as errors before you applied the grouping? I'd try replacing zeros with null before grouping.

Mynda

Avatar
Adam Smith
Member
Members
Level 0
Forum Posts: 45
Member Since:
December 18, 2018
sp_UserOfflineSmall Offline
3
July 11, 2020 - 11:35 pm
sp_Permalink sp_Print

Mynda, whatnks for your reply. I'm afraid that didn't work. I'm not sure how I can possibly send you an example book as it's entirely made up of workers' names, companies and workforce hours. 

I suppose the best I can do is describe better.

 

Column A contains Month (June or July on every row)

Column B contains company names (Company 1 (three rows), Company 2 (8 rows), etc.)

Column C contains workforce hours (decimal numbers)

I've tried replacing all the zeros with nulls before grouping them, as you suggested. It returns the following error: 

DataFormat.Error: We couldn't convert to Number.
Details:
-

Is there a chance that the instances in July where there are no hours yet at all return hours?

 

Thanks again.

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4443
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
4
July 12, 2020 - 10:33 am
sp_Permalink sp_Print

Hi Adam,

I can't reproduce the issue. When you have confidential data you can create another file with dummy data or remove/replace the confidential information to anonymise it.

I have had to create a dummy file in order to try and follow the issue and reproduce it. You can see in the attached that the zero values are not causing a problem.

Mynda

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1807
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
5
July 13, 2020 - 1:00 pm
sp_Permalink sp_Print

Hi Adam,

Basically, the answer is already in the error message:

DataFormat.Error: We couldn't convert to Number. Details: -

That means you don't have zero's in some cells, you have text "-", so if you simply replace "-" with null, before replacing 0 with null, will work.

Avatar
Adam Smith
Member
Members
Level 0
Forum Posts: 45
Member Since:
December 18, 2018
sp_UserOfflineSmall Offline
6
July 14, 2020 - 12:39 am
sp_Permalink sp_Print

Thank you both for the help. Can't believe I missed what was staring right at me - Catalin, great suggestion. I can't convert "-" to null or zero, as it's a non-numeric value. From looking around on the internet, it seems I just have to let it change to Error and then replace Error with 0. This will still accomplish what I'm after.

Thanks again to both of you.

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Brian Pham
Guest(s) 9
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 870
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
A.Maurizio: 202
Jessica Stewart: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
drsven
Annie Witbrod
wahab tunde
Cong Le Duc
Faisal Bashir
Ivica Cvetkovski
Blaine Cox
Shankar Srinivasan
riyepa fdgf
Hannah Cave
Forum Stats:
Groups: 3
Forums: 24
Topics: 6205
Posts: 27211

 

Member Stats:
Guest Posters: 49
Members: 31880
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.