Generating summaries automatically - excel

Part of my job is to pull a report weekly that lists patching information for around 75000 PCs. I have to filter some erroneous data, based on certain criteria, and then summarize this data myself and update it in a separate spreadsheet. I am comfortable with pivot tables / formulas, but it ends up taking a good couple of hours.
Is there a way to import data from a CSV file into a template that already has in place my formulas/settings, etc. if the data has the same columns, but a different amount of rows each time?

If you're confortable with programming, then, you can use macros, on this case, you will connect to your CSV file, then extract the information and put it in the corresponding places on your spreadsheet, on this question you can find most of what you need to start off: macro to Import csv file into an excel non active worksheet.

Related

Comparing data between two sheets in Powershell - how to find data after cells with specific values?

To start, unfortunately I cannot use Import-Excel (yet! organization is looking to implement the module "soon") or other outside modules, so am just working with excel objects manually.
I made an automated report that appends to an excel document every day. It looks something like the included picture. The servers and their data are not in the same cell position for each daily sheet, but are always grouped together (so Server1 and its data might be in the middle of today's sheet, but at the beginning yesterdays sheet). Databases can change, so I'll also be looking into error checking that a database actually exists on both sheets to compare them.
I want to check the most recent sheet (sheet labeled 2020-08-10) and compare each database with the same databases on the oldest sheet (sheet labeled 2020-08-08) to get a size % difference between each database, but I can't seem to figure out how to automate finding the multiple "Database" rows of each server, then going down and grabbing each database and size to compare.
Any help or guidance to get me researching in the right direction is appreciated.

How to use PowerBI to automate reports?

I'm a new user to powerBI but I'm trying to use it to automate some reporting systems that are pretty tedious. There are 3 things that I want to achieve with PowerBI:
Create pivot tables, filter data, and return an excel/csv file with vlookups
Maintain a history of certain columns somewhere within PowerBI
Generate graphs/informatics & easily export back to an excel/csv file
To give a little more background, the current process is to clean the excel file received, filter, run some vlookups, generate multiple pivot tables, and create graphs within excel from those pivot tables. Some of the graphs require a history of past reports in order to generate them; we've been copying certain data from the last report as necessary.
Ideally, I'd like to input a raw data file into PowerBI and have it automatically spit out one excel file with all the pivot tables, and also have it automatically create graphs on multiple dashboards.
I'm not sure if it's even possible to maintain a history of files with PowerBI. I'm aware that you can upload new excel files, but I'm under the impression that you'd have to go through the steps of generating the graphics all over again. Resources would be greatly appreciated.

Easiest way to automate the creation of charts given an input Excel file

I'd like to automate the creation of monthly reports. I have a database through which I can export an Excel file (or csv, for the record). The table format is such that the number of columns (~500) will always be the exact same, but the number of rows (25-100) is variable.
The end goal is an excel tab with a few graphs/charts based on said data. For the charts, I'll only need to use maybe 10 columns of data out of the 500, but all of the rows.
I would like to automate the creation of this report as much as possible. Ideally, it will be able to be used by people with limited Excel knowledge. I would think I could set it up such that they can export the file out of the database, input it into my created sheet, and receive an output of charts.
This seems simple but I can't find much info on something like this. I just want to tell Excel "for every inputted file, make a pie chart out of these columns, a line graph out of these columns, a bar graph out of these...etc etc"
Power Query is where I started, and it helped to clean up the large number of unneeded columns, but I don't see where the functionality to automatically create charts comes into play. Macros/VBA seemed like an obvious next step, but I'm worried about how to set it up such that other users won't have to mess with the macros to get a desired end result. Again, ideally it would be as simple as inputted a file path, clicking a button, and getting graphs outputted.
Any tips or advice on how to approach this or what Excel tools that would be easiest to use would be great. Thank you in advance!

Copy and paste Excel rows between two workbooks based on criteria from exported Access data

I have no previous experience in Access, VBA coding or in Excel macros prior to teaching myself the past month via these forums. Thank you forums and contributors. I have enjoyed my Access learnings so far, the challenge that it has provided and appreciate any help that I can get. As such, the code and methods that I have used to this point may well be convoluted and confusing. I will do my best to provide relevant details and accurate terminology.
I work in a lab and I am creating an Access Form for semi-automated reporting. Samples are received from clients and are logged into the Excel Table R&D Log. The worksheet is InProcess. Samples are sorted based on the site in which they originate and given a one or two letter site code (G, D, WH, etc.) and an ID "yy-000" in separate Excel columns (i.e. D 18-096). Samples may be submitted for multiple analyses (Metals, Water, Soil, etc.) and may even have multiple rows of reporting if multiple analytes are identified in the sample. There are several other columns, such as receipt date, reporting date, units, etc. Once samples are reported, I manually copy and paste them into the Archived worksheet, and delete the record and blank row from the InProcess worksheet. Since one sample may have multiple analyses and even more potential results, each record would be reported on a new Excel row (with the same D 18-096 ID number). Thus, there is not a single unique identifier or primary key for each sample in the current format. R&D Log is updated manually by lab technicians and the worksheet InProcess is a linked table in an Access Database.
The Access Database is using two combo boxes on a Form frmInProcess to filter a Query qryInProcess of the linked table. The combo boxes are filtering the report destination (one client may receive multiple site codes) and the analysis (reports are separated based on type of analysis). The Query is also filtering out blank results and blank dates, so only completed samples will appear on the filtered Form. I have generated VBA code to this point that will export the Form to a .pdf, save the file with unique filename, and open outlook to mail out the report. I have also managed to export the filtered Form frmInProcess to an Excel file Access Test (not the linked file).
What I would like to do now is to automate the transfer of completed test results from the Excel worksheet R&D Log: InProcess to R&D Log: Archived and delete the record from the InProcess worksheet. I am not sure if I can export the filtered Form into a linked Excel table, or if I must use a separate Excel file (or if it even matters for simplicity of code?). I would now like to read the exported filtered Form in Excel Access Test, lookup matching rows in R&D Log based on several criteria (site, ID, Analysis, Analyte, Report Date) and automate the transfer of records between R&D Log worksheets. End result being that Access generates reports for completed tests, and the records are removed from InProcess testing and transferred to Archived testing in Excel. I am guessing that I may need to close the Access application and perform this in Excel. Hope this is easy enough to follow.
Thank you.
In my experience, importing an Excel document into a temporary NEW (or totally empty) Access table is usually the easiest way to go. Then you do not have to worry about cell references like you do in Excel VBA. Even if the Excel document has old data in it with just a few new changes each time, importing it into a temporary Access table could be the simplest way to go, because then you can compare the data in this table with the data in another, permanent Access table and update the latter based on the former.
As far as the original Excel file, if you need to delete rows there, it might be quicker to export a new Excel file with just the data the old one is supposed to end up with, and then use VBA to delete (or - safer! - rename) the old file.
So the development process goes something like this:
Save import steps by first importing an Excel file via Access' ribbon options "External Data" (tab) ->"Excel" and when you finish, be sure to check the "Save import steps" box and note the name you give the "saved import" because you will need that in your VBA code.
In Access, write a function for deleting the table. The VBA code is:
Const cTable = "MyExcelTempTable"
If TableExists(cTable) Then
DoCmd.DeleteObject acTable, cTable
End If
Now you can test your delete function on the data you imported.
Write VBA code to import the same spreadsheet to create the same table:
Const cSavedImport = "Import-MyExcelTempTable"
' Import the Excel file
DoCmd.RunSavedImportExport cSavedImport
Write more VBA function(s) to check the imported table for bad data and then to copy it into the permanent table. You might be updating existing records or adding new ones. Either way, you could use Access queries or SQL to do this and run them from VBA.
Write a VBA function to rename the old Excel file. (You could use an InputBox if the Excel file name is different each time. I do this for importing Excel files, and I set a default value so I do not have to type as much.)
Write a VBA function to export the new version of the Excel file.
Make yourself a button on a form that, when clicked, runs a VBA function. Inside that function, run Steps 2 through 6, above.
I am not sure my answer exactly matches what you are trying to do, but hopefully you get enough of a picture of the workflow to figure out the details of what you need.

Why is the text in my excel spreadsheet created from csv treating everything as text?

I wrote a python script to generate some data into a csv file. The data looks something like the following:
12/10/2015 1 0:05:38 0:09:18 0:00:24 0:15:20
5/11/2016 1 0:39:07 3:22:09 0:00:08 4:01:24
7/27/2016 1 0:00:00 0:37:42 0:02:12 0:39:54
8/4/2016 1 0:00:00 0:00:29 0:00:35 0:01:04
10/3/2016 1 0:05:51 0:50:46 0:00:17 0:56:54
The data I am interested in analyzing is in the form of h:mm:ss but formuals that I write to sum the information doesn't work. I figured out that the ISTEXT(CELLNUM) is returning TRUE so it is clearly treating the data is text even if I manually reformat the cells as h:mm:ss. I must be overlooking something simple because there must be a way to do this easier without having to go through a process every time I open a CSV into excel and save it as a spreadsheet. How can I open this csv into excel and save as a spreadsheet in a way that I can setup formulas to sum the times? I might end up creating a lot of these CSV files so I need a way to do it that is fast. What am I missing? Why isn't simply selecting all of the cells and reformatting them working?
The best answer is posted here by jeeped
When you have pasted data from an external source (e.g. web pages are
horrific for this) into a worksheet and numbers, dates and/or times
come in as textual representations rather than true numbers, dates
and/or times usually the quickest method is to select the column and
choose Data ► Text to Columns ► Fixed Width ► Finish. This forces
Excel to reevaluate the text values and should revert the
pseudo-numbers into their true numerical values.
It's strange that excel can't figure this out or provide a way to do it as the data is imported. It can handle dates during import but not time. However the fact that I can so easily fix the time values one column at a time after saving as an xlsx file makes me wonder why Microsoft never bothered to just make it easier to specify what the columns are when bringing in the data the first time. Instead I have to search the internet for hours on end to ultimately find a solution that takes just a minute or two. Weird. There are some other answers posted for other types of data where you can use paste special to add a number to the existing data but those solutions do not seem to work for time.

Resources