• 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

vba code required to manipulate data - not too sure how to describe it but included details below|VBA & Macros|Excel Forum|My Online Training Hub

You are here: Home / vba code required to manipulate data - not too sure how to describe it but included details below|VBA & Macros|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 ForumVBA & Macrosvba code required to manipulate dat…
sp_PrintTopic sp_TopicIcon
vba code required to manipulate data - not too sure how to describe it but included details below
Avatar
Bryan Robson

New Member
Members
Level 0
Forum Posts: 2
Member Since:
August 19, 2022
sp_UserOfflineSmall Offline
1
August 19, 2022 - 7:25 pm
sp_Permalink sp_Print

Hi. First post. Hope someone can help me

The attached file is just a sample and the original has much more data but I have deleted rows out of it and also changed some of the data as it is sensitive information.

I need the code to use the start month of the billing period and the end month of the billing period by using the Start sheet and selecting the month from the drop down lists in columns E and G

For some sites there may be more than 1 row. For example, row 35 and 36 and there are others. This is because while we are at the site, we have done 2 jobs or more.

No Visits in column F is the number of visits to that site booked (not necessarily completed yet). But, if a site has more than 1 row for example row 35 and 36, then the number of visits is 3 not 3 + 3.

Then the 1 indicated in cells January to December represent when the work has been booked in and green if it has been completed. Sometimes the work may not get done as the engineer couldnt go, it was cancelled or the engineer arrived on site and couldnt do the work. So these will not be green.
The cells also have comments stating the date when the work was done.
e.g. Clean done 20/04/2022

What I need is to consolidate the data explained above. I need the same column headings on an output sheet. But, firstly, one line only for each site. The value of the number of site visits are not to be added together (just use the number in that cell). Then add up the numbers in January to December only if the cell is green and only if those months fall within the start month and end month selected in the drop down on the Start sheet. Also include the inserted comment eg Clean done 20/04/2022 in a cell.

I have included a sheet called Sample Output. So, basically if the period to be billed is June, July and August then this would be the expected results.

Thanks in advance

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1810
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
2
August 22, 2022 - 2:23 pm
sp_Permalink sp_Print sp_EditHistory

Hi Bryan,

It's much easier with Power Query, see the file attached.

To get the results, simply right click the PQ Output table and click Refresh, or from ribbon, Data tab>RefreshAll

However, it does not take care of colors and comments. 

The design of the data structure is not the most efficient according to the processing needs, normally a solution must be designed with the entire process in mind. Comments should be simple text in another column, instead of colors there should be a Status column with standardized options: Active, Completed, or any. Because each month needs 3 values: 1, notes and status, you decided to put all 3 in one cell using cell comments and status, but each entry should have their own record, in a properly organized data collection structure:

image_2022-08-22_074359131.pngImage Enlarger

This tabular structure can be analyzed with default excel tools, most of the times programming is required when the structure is not properly designed.

sp_PlupAttachments Attachments
  • sp_PlupImage image_2022-08-22_074036375.png (45 KB)
  • sp_PlupImage image_2022-08-22_074359131.png (45 KB)
Avatar
Bryan Robson

New Member
Members
Level 0
Forum Posts: 2
Member Since:
August 19, 2022
sp_UserOfflineSmall Offline
3
August 23, 2022 - 8:25 pm
sp_Permalink sp_Print

Hi. Thanks for the reply. The file comes from another team in that format and they want to manipulate the data for billing. I will relay your comments back to the team.

 

Thanks

Darren

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Clayton Watson
Guest(s) 9
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 871
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
Jessica Stewart: 204
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Murat Hasanoglu
Brett Dryland
Saeed Aldousari
Bhuwan Devkota
Kathryn Patton
Maria Conatser
Jefferson Granemann
Glen Coulthard
Nikki Fox
Rachele Dickie
Forum Stats:
Groups: 3
Forums: 24
Topics: 6222
Posts: 27292

 

Member Stats:
Guest Posters: 49
Members: 31913
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.