I'm writing a spreadsheet to track performance through time. As there is several iterations for each dates, it was way better for the eye to show each ones in a table and not everything in just one row. The result is a sheet where for each dates there is a table :
This is a reduced version for this present post, there is more columns and more rows for each dates (otherwise, yes, it could have been on one row only).
Each time we'll make a new evaluation, we'll copy a table in this FullData sheet, put it after the last one, and change the date.
As this sheet is very dense and because I'll later create graph of some indicators on time, I want to create a simplified sheet (Overview) that "receives" the data from the previous FullData sheet. The aimed table looks like this :
As you can see, the goal is to sum up each tables of the FullData sheet, in one row in the Overview sheet.
Ideally, it will automatically appear as a new line to the Overview, if there is a way to make it "detect" a new table/date.
I'm quite unskilled at spreadsheets. I get the mechanic but I'm super ignorant about the different functions. I explored around INDEX, Dynamic Cross Tables (I translate from french, not sure it's exactly the english name) and have the big intuition Named Ranges are in play here.
As the tables will always have the same size, there is maybe a way to indicate the date cell with a constant increment formula?
I get this isn't the only question here, It's my first post and feel free to tell me if it's not narrow enough, I just wanted to provide a wide view on the situation.
To sum up the questions I identify (for what I discover with spreadsheets, there is always a new question I didn't think about)
How to select the informations I want from the FullData sheet to the Overview one, in a way that will be easy to repeat each time I create a new table/date?
Is this possible with the "basic" functions, avoiding macro/script (it would be another world to me)?
Can automatic the process can be? Spectrum of automation : I just copy a new table with a new date and the selected data appear in the Overview <> I tweak the copied table each time, by naming it and/or adapt the formulas of it's original version.
Thanks for your reading of my non-technical, non-totally english prose.
try:
=QUERY({FullData!B2:B\
{QUERY(FullData!L2:Q; "offset 2"; 0);
{""\""\""\""\""\"";""\""\""\""\""\""}}\
{QUERY(FullData!L2:Q; "offset 3"; 0);
{""\""\""\""\""\"";""\""\""\""\""\"";""\""\""\""\""\""}}};
"where Col1 is not null and not Col1 matches 'Amount|Duration'"; 0)
Related
I have a list of items, expiry date, quantity, and usage. Goal is to find out how much of each item of each expiry date, if any, will need to be written-off as unused before expiring.
Different items may have different number of expiry dates. Assumption is that the shortest expiry dates stocks are used first (EEFO) [so different lines of the same item are linked], and that when stock expires, it cannot be used anymore.
I am assuming a VBA loop macro somehow is the best method. I was reading up and thought that maybe an array would be necessary too but I am a complete newbie at this.
You don't really need VBA for this. You could do this with Excel formulae and it'd be really easy with some helper columns. If you don't want to show the helper columns you could put them on a 2nd hidden sheet and then just show the result on the display sheet. Any VBA you write would essentially do the same thing but with looping etc. might get a bit complicated if you're new to it.
To get these results:
I used these formulae:
I took your figures for item "E" but made up my own for item "D" so I could test changing the item in column A to make sure it worked.
Like I said in a comment, make sure that your expiry dates per item are sorted ascending.
(e.g. sort on expiry date, then items to get this table to work)
Another word of advice, if this stuff is happening on a grand scale then a SQL database would be good, if you have MS ACCESS you could try putting the data in there and re-asking the question.
I'm trying to query some data in Postgres and I'm wondering how I might use some sort of pattern matching not merely to select rows - e.g. SELECT * FROM schema.tablename WHERE varname ~ 'phrase' - but to select columns in the SELECT statement, specifically doing so based on the common names of those columns.
I have a table with a bunch of estimates of rates over the course of many years - say, of apples picked per year - along with upper and lower 95% confidence intervals for each year. (For reference, each estimate and 95% CI comes from a different source - a written report, to be precise; these sources are my rows, and the table describes various aspect of each source. Based on a critique from below, I think it's important that the reader know that the unit of analysis in this relational database is a written report with different estimates of things picked per year - apples in one Table, oranges in another, pears in a third.)
So in this table, each year has three columns / variables:
rate_1994
low_95_1994
high_95_1994
The thing is, the CIs are mostly null - they haven't been filled in. In my query, I'm really only trying to pull out the rates for each year: all the variables that begin with rate_. How can I phrase this in my SELECT statement?
I'm trying to employ regexp_matches to do this, but I keep getting back errors.
I've done some poking around StackOverflow on this, and I'm getting the sense that it may not even be possible, but I'm trying to make sure. If it isn't possible, it's easy to break up the table into two new ones: one with just the rates, and another with the CIs.
(For the record, I've looked at posts such as this one:
Selecting all columns that start with XXX using a wildcard? )
Thanks in advance!
If what you are basically asking is can columns be selected dynamically based on an execution-time condition,
No.
You could however use PL/SQL to build up a query as a string and then execute it using EXECUTE IMMEDIATE.
This is my first question on StackOverflow so apologies if there is not enough appropriate information.
Rather than having four different tables that I try to position 'just so' so that they look like one table, I was hoping to have all of my data in one visible table and hide the rest.
To do this I was trying to use LookupSet/Lookup with Running Value (I need a cumulative figure for each fortnight from a start date).
I have used the following code which supplies me with figures in the table - however the figures seem to be nearly double what they actually are.
=Lookup(Fields!StartFortnightDate.Value, Fields!StartFortnightDate.Value,
Fields!RowIdentifier.Value, "KPI004")
Is it possible to use Lookup with RunningValue? It won't let me use ReportItems either its obviously only pulling from the first box and therefore is just repeating the first figure again and again.
Any help, guidance, or even a simple "it's not possible" would be appreciated.
Edited to add more information as suggested:
It's difficult to add example data without worrying about data protection etc.
Report design is currently:
ReportDesign
Each table has it's own dataset - I'm trying to get them all into one table.
Lets say the first dataset is number of cars sold in each fortnight.
The second dataset (table) is number of meetings held.
The third dataset is number of days weather was sunny/cloudy/rainy etc.
(This obviously isn't what the datasets are, but I'm trying to show that they don't actually relate to each other that much and therefore can't all be in the same script)
All datasets have a table of the fortnightly dates within that quarter, my hope was to get one table that showed the cumulative figures of each item even though they're not in the same dataset - the tables are all grouped by the StartOfFortnightDate.
The script =RunningValue(Fields!NumberOfFordCarsSold.Value, Count, Nothing) and similar works fine in the separate tables, however if I add a row to the top table and try to use RunningValue with Lookup it doesn't work.
When I used the script mentioned at the top (Lookup script) I get inflated figures (top row of this image) compared to the expected figures (bottom row of the image): IncorrectAndCorrectFigures
Apologies if this doesn't make sense, it's likely that my complete confusion in trying to find the answer is coming across in the question.
If the resulting datasets are all similar then why can you not combine them?
From the output they seem to be just Indicator & Date.
Add an extra column to indicate which set of data each row belongs to (Cars Meetings etc), this might help with grouping rows in the report.
A bit of a tricky question - I might just have to do it through VBA with a proper script, however if someone actually has a complicated answer, (let's be honest I don't think there's a super simple formula for this) I'm taker. I'd rather do as much as I can through formulas. I've attached a sample.
The data: I have data that relates to countries. In each country, you can have multiple sites. For each site, you may or not have different distributions. When those distributions meet a given criteria, I want to tally up that as a "break" & count how many by countries, sites, etc.
How it works: I'm using array formulas with sumproduct() for this. The nice thing is that you can easily add criteria, each criteria returns your 0/1 so when you multiply them it gives you the array you need to sum up to see how many breaks you have.
The problem: I am unable to format the formula so that I can account for each site being counted only once in the case where the same site has 2 different distribution types and both meet the break criteria. If both distributions meet the break criteria, I don't want to record that as 2 breaks, otherwise I may end up with more sites with breaks recorded than the number of sites. Part of the problem is how I account for the unicness of sites:
(tdata[siteid]>"")/COUNTIF(tdata[siteid],tdata[siteid] &"")
This is actually a bit of a hack, in the sense that as opposed to other formulas it doesn't return 0/1 but possibly fractions. They do add up correctly and do allow me to, say, count the number of sites correctly, but the array isn't formated as 0/1 therefore when multiplied with other 0/1 arrays it messes up the results....
I control the data, so I have some leeway. I work with tables (as can be seen) and VBA is already used. I could sort the source tables if that helps. Source data:
1 row = 1 distribution for 1 site on 1 month
The summary table per country I linked is based on those source data.
Any idea?
EDIT - Filtering for distribution is not really an option. I do already have an event-based filters for the source data, and I can already calculate rightly the indicator for filtered data by distributions. But I also need to display global data (which is currently not working). Also there are other indicators that need to be calculate which won't work if I filter the data (it's big dashboard).
EDIT2: In other words, I need to find some way to account for the fact that if the same criteria (break or not) is found in 2 sites with the same siteid but 2 different distributions, I want to count that as 1 break only. While keeping in mind that if one distribution has a break (and the other not), I still want to record it as 1 site with break in that country.
EDIT3: I've decided to make a new table, that summarizes the data for each site individually (each of which may have more than once distribution). Then I can calculate global stuff from that.
My take home message from this: I think that when you have many level of data (e.g. countries, sites, with some kind of a sub-level with distributions) in Excel formulas, it's difficult NOT to summarize the data in intermediate tables for the level of analysis at which you want to focus. E.g. in my case, I am interested in country-level analysis, which is 2 "levels" above the distribution level. This means that there will be "duplication" of data from a site-level perspective. You may be able to navigate around this, but I think by far the simpler solution is to suck it up and make an intermediate table. I does shorten significantly your formulas as well.
I don't mark this as a solution because it's not what I was looking for. Still open to better suggestions allowing to work only with formulas....
File: https://www.dropbox.com/sh/4ofctha6qhfgtqw/AAD0aPJXr__tononRTpKc1oka?dl=0
Maybe the following can help.
First, you filter the entries which don't meet the criteria regarding the distribution.
In a second step, you sort the table from A to Z based on the column siteid.
Then you add an extra column after the last on with the formula =C3<>C4, where column C contains the siteid entries. In that way all duplicates are denoted by a FALSE value in the helper column.
After that you filter the FALSE values in this column.
You then get unique site ids.
In case I got your question wrong, I would be glad about an update in order to try to help you.
I have a large table of market values with rows labeled with each asset name and each column representing each month between 2000 and 2014.
The table I have is currently blank and I want to use an index / match function to search for the data corresponding to each date / asset combo in data that was submitted to me. My problem is that this submitted data is slightly inconsistent in how it names assets at different points at time. One year may have an asset called Goldman Sachs Strategic and another year may label the same asset as GS Strategic Income.
I would like to allow for the user of the spreadsheet to type names that are actually equivalent to each other. On a sheet called equivalent names I would like have cell A1 be Goldman Sachs Strategic and B1 to be GS Strategic Income. I was hoping there was a way to make A1:B1 an array that could then be used as a lookup value within my index / match function.
I realize this probably is not the way to approach this problem but I have a very limited dictionary of solutions because I have limited experience coding and using excel. I was hoping someone could point me in the direction of a solution that would actually work because I am assuming inconsistent data is a problem many people have dealt with before. Thanks a lot for any help that you can offer!
I created some random data to test with
I then created the following table on the second worksheet.
The last 5 columns (2010,2011,2012,2013,2014) represent the year to year names. Using these names (which may or may not be blank), we simply use a series of concatenated SUMIF() functions.
Because you didn't provide specific data, I understand that this answer might not fully fit your question, so if there is anything that is incorrect, let me know. Otherwise, I hope this helps.