Excel copy function with rotation - excel

I have a spreadsheet with two portions, the first's rows are usernames and columns are data types (availability, ID, email etc), the second's rows are the data types and columns are the usernames. The second's values must be calculated based on what is in corresponding cells in the first. The second isn't simply copied from the first, each cell contains calculation based on multiple columns of the first portion.
I have been asked to keep these as they are currently, as in don't just create new new columns in the first portion or rotate the second.
So my question is: is there a way that I can copy a function across columns in a way that the variable changing by column is the row number not the column number?
I know the thing I'm trying to do makes no sense. Makes no sense to me neither, but this is what I've been asked to do.

Ended up using a whole bunch of INDIRECT(ADDRESS(MATCH, MATCH)) functions to get the values then get the desired values from them into the second portion.
A second table or extra column would've been so much cleaner but hey, to each their own.

Related

Excel automatically sort column of numbers

I am looking to automatically sort a column of numbers in descending order without touching the sort button, or VBA.
Unfortunately I am trying to achieve this in a work environment where I have no access to VBA and excel is not one of the latest versions that contains the new SORT function in 365.
It is quite literally a column of numbers, and the numbers are automatically updated as they are totals of rows of smaller numbers elsewhere, and these change based on something else - so this specific column will always change numbers, but I need the column to automatically keep on top of sorting numbers by descending order.
I tried using rank.eq and some other bits with adding a 1 to each row to avoid duplicates, but this buggered it up if more than two duplicates was found. Is there anything I can do at all? Even if it involves going a very long way round it and building extra tables and things etc.
Grateful for any help.
It'd be easier to see your data and without being able to use a spill range, it's impossible to know how many rows. I also think you're intending to use LARGE function rather than RANK.
If you had your numbers in column A, you could drag the following formula down the appropriate number of rows to get the numbers sorted... (starting in cell B1)
=LARGE(A$1:INDEX(A:A,COUNTA(A:A),1),ROW())
If you can get your numbers in a table, you could use a similar formula but the table would ensure the appropriate rows exist (assume table name is Table1 and note the column names of RawNumbers and Sorted). Put this in Sorted Column:
=LARGE([RawNumbers],ROW()-ROW(Table1[[#Headers],[Sorted]]))
I presume using a pivot table is not a viable option... but these are how you could accomplish your objective of sorting by formula.

Is there a way for Excel VBA to automatically detect groups of data (groups separated by blank rows) and write averages of the data to another column?

Currently, I am trying to calculate daily averages of the availability and performance of machines. In the raw data, each machine has a different number of data points that are needed to make an average from.
Is there a way to get VBA to auto-detect the group of rows, and from then, take the average of the data in those rows?
At the moment, I have it being completed in an inefficient and buggy way held together by duct tape. The ActiveCell moves down until it finds a non-blank cell. It stores the value of the cell into an array and adds more data until it reaches a blank row. Then, it writes the value to the average column, clears the array, and moves down until it reaches a non-blank cell.
I am aware that ActiveCell.select is a terrible way to code, but I don't know of any more elegant ways to accomplish this task.
A sample of how the data will look
If you know there will not be duplicated machines, AverageIfs() is a great option, just make sure to add an And() to check current row and next row as seem below.
If there may be duplicated machines, you can use XMatch() to find the first empty row, and use either indirect() to build your AverageIfs() formula (like i did... but only useful if your data will always be in the same place) or use XMatch() along with Offset() and Sum() if you need the data to move more easily. One drawback is requiring a blank row at the top of the data, but this could be worked around with an additional if statement.
Please note: Yellow cells indicate where the formula was pulled from.

How to Isolate Rows of a Table Given One Column Using Two Variables

So I want to isolate all of the rows that are labeled 'Good' from all the rows that are labeled "bad".
I've tried to use the 'sort and filter' tool in excel, but this hasn't worked, I think due to the presence of the index table, which I've used to generate my formulas.
Here are the formulas being used to obtain a unique number for each row, which I then use to determine whether a value is "good" or "bad".
For reference, not all the boxes in the spreadsheet that are green are labeled 'good'.
This can be done by using an if statement and matching to the relevant number in the table, then printing the corresponding column data. This will need to be repeated for each column of data you want to use. An example of the code is given below;
=IF(ISNUMBER(MATCH(A2,AB:AB,0)),AG:AG,"No Data")

Combining Non-Zero Values from Multiple Columns into One in Excel

Every month I get given a budget from one of our clients in a Google sheet, which I need to convert into a SQL query so it can be uploaded into our database. As the number of rows and columns changes, I want to write some formula to semi-automate the process for time saving and mistake elimination.
This budget has spends in multiple columns, which I've managed to write formulas to combine into one column, with the correct details in the columns next to it (see example links below).
How I've transformed the data so far
The issue is this budget per country and partner, then has to be split again across multiple options. This leaves me with three columns worth of spend values, that I'd really like to combine back into one column, and ideally skip out all the zero values.
I've found an array formula on this site that will skip the zeroes, but I can't get it to work on more than one column.
=IFERROR(INDEX($U:$U,SMALL(ROW(myRange)*(myRange<>0),SUMPRODUCT(N(myRange=0))+ROWS($1:1))),"")
From this Question's Answer
Is it possible to write a formula, that skips the zero values down one column, and then starts at the next? And that will also allow me to keep the correct matching details from the other columns alongside it, as well as bring in the column headers for the options as entries in a new column?
Thanks
Edit:
Here is the final format I'm looking for:
There is a concatenated field off the end that combines all the columns. Most of the values are populated by various Vlookups, to transform from the text version, into the database IDs, needed to fill the table.
It's also worth saying, that not being able to skip the zeros, is OK, as I can manually delete them fairly easily.
But as the number of countries and partners can and will change, I want the formula to be able to move column at the end of the dataset.

How to sanitize a collated column with text and numeric data to make it uniform for easy analysis in excel 2007

I have 3 column heads and I wanted to collate it with 3 similar heads from another sheets. 10% at an average from each of the 6 columns is blank, I have to map the data based on these 3 columns to other data and I need them to be sanitized. So there are the blanks and then there are some cells which have text like 208110185726A570-14. Please help.
Haven't heard back from the comment above, but I'll have a go at this anyway (and will be using assumptions that may be incorrect):
Given that you have included the tag vlookup, I'm assuming that you want to build a table that uses the leftmost column as an index of unique values to conduct a VLOOKUP. If that's the case, I don't see any way around blank cells in the leftmost columns in the two sheets, other than saying that the ensuing VLOOKUP would skip over any row that had a blank leftmost cell.
If you can live with that, the way I would go about it is pretty simple:
Copy the columns from one group (omitting the header row) and paste them to the end of other group. Again, since you have mentioned VLOOKUP, I'm assuming that keeping the cells in the rows next to each other is the goal (i.e. you can't remove the blanks in the columns because otherwise that would mess up the horizontal integrity of the cell relationships).
Do your VLOOKUP. Again, I'm assuming unique values in the leftmost column. This assumption is important, because it will make a difference to the decisions you make about what type of VLOOKUP you use (range vs. exact match) and what value is returned. For example, if you use exact match and there are repeating values, it will return the 1st match it finds.
Again, the assumptions might be wrong, but the question is a little unclear.

Resources