Excel linked data and sorting - excel-formula

I have 2 spreadsheets.
spreadsheet 1 is the master data spreadsheet
spreadsheet 2 reads columns A, B, C & D from spreadhseet1 and populates columns A, B, C & D of spreadsheet 2..
I then write data to columns E & F in spreadsheet 2.
all works well, until someone sorts the data in spreadsheet 1.
when I open spreadsheet 2 the first 4 columns have changed to reflect the sorting that occurred in spreadsheet 1 but the manually entered data in columns E & F of spreadsheet 2 have remained where it was typed, ie it did not move with the sorting.
how can I fix this folks?
many thanks for any help with this

It would be helpful if you provided the formulas you are using in the sheets however from your question it sounds as though you are simply using something like this in cell A2 of 'Spreadsheet2':
='Spreadsheet1'!A2
This means that whatever is in cell A2 in 'Spreadsheet1' will be in cell A2 in 'Spreadsheet2'.
The best way to link two spreadsheets is using a static column of unique ids alongside an INDEX/MATCH function so that regardless of the position in 'Spreadsheet1' the values will be matched up with the unique ids.
For example if your unique IDs are in Column A of both spreadsheets you could use this formula in cell B2 of 'Spreadsheet2':
=INDEX('Spreadsheet1'!B:B,MATCH($A2,'Spreadsheet1'!$A:$A,0))

Related

Building an Excel table based on specific cells from another sheet

I am making a table of averages based on a large table in another sheet.
The original table has 27 samples each with 3 repetitions of "sample name" in column D along with 3 repetitions of "data" in column H through O
ex: Cells D4-6 "22L9" Cells H4-6 "0.21","0.32","0.23"
D7-9 "22p3" H7-9 "0.11","0.42","0.43"
The new table I want to auto-populate column A in the new sheet the first rep. of "sample name" from the original table, in column B an average of the three "data numbers" from H, column C from I, and so forth.
I have tried =AVERAGE('Sample data A'!H4,OFFSET('Sample data A'!H4,3,0))& =AVERAGE('Sample data A'!H7,OFFSET('Sample data A'!H7,3,0)) and filling down but it does not skip cells in the next formulas
I think I understand what you’re trying to do. Even if I haven’t nailed it, I hope this approach gets you started.
Instead of doing the selecting yourself using OFFSET(), let Excel do it for you by using AVERAGEIF(). AVERAGEIF() says “average only those values from column B in rows where column A matches some value.
Let’s say you enter “22L9” in cell A2, “22p3” in cell A3, etc.
Then in cell B2:
=AVERAGEIF(‘Sample data A’!$A$2:$A$50, A2, ‘Sample data A’!$H$2:$H$50)
And then copy that down for how ever many column A values you have. In my formula, I used A2:A50 and H2:H50, I leave it to you to make those ranges match whatever rows contain your data.

Formula for filter column in Excel

Please suggest a formula for the following requirement:
One Excel sheet 1 has column A,B,...
Say, Column A has list of Email Addresses of about 2800+ users
(Column B has something irrelevant)
Say, Column C is tilted Date and Column D is titled Status
Another excel sheet 2 has Column A with email addresses of 100+ users.
My requirement:
In Sheet 1,
I want to filter out the 100+ users in column A and these 100+ users are present in Sheet 2
(I could paste the 100+ users from Sheet 2 to say Column E of Sheet 1
such that only Sheet 1 need to be considered)
So I want to filter 100+ in comparison to column E 100+ names (after copying as above)
Then I can fill in Column C & D after filter.
Note : I don't want to delete rest of the names in Column A, just want to apply filter according to Column E such that only the 100+ names appear in column A so I can fill the corresponding data in Column C & D
You can whitelist / blacklist values via the COUNTIF function in a filter.
=FILTER( range to return, COUNTIF( needle, haystack "range to return"))
So if you wanted to create a third sheet and paste those columns as you shown above you could paste this formula in cell A2...
=FILTER( 'Sheet 1'!A2:D2801, COUNTIF('Sheet 2'!A2:101, 'Sheet 1'!A2:A2801))
And it will auto-populate columns A-D with your desired data. This formula is assuming your 100 desired names are on column A starting on A2. I'm sure you can tweak this a little to fit your needs

Rearrange whole rows, based on a variable depending on formula result, after sorting the source table

I have an issue with using data from a source table:
Lets say we have Sheet 2, where in column A is the formula
=IF(Sheet1!A1 = 0;"";Sheet1!A1)
I am taking only the newest info form Sheet1 to keep another type of data in Sheet2 about the given value. In columns B,C & D in Sheet2 I have manually input data, relating to the result value from Column A.
The issue is that the information in Sheet1 needs to be kept chronologically, so if the last(newest) row is with an earlier date, Sheet1 needs to be sorted by date. This of course automatically sorts the values in column A of Sheet 2, based on the formula. However, all data in B, C & D is still based on the values, before the sort, as it is manually input.
Is there a way to move around the whole rows in Sheet2, based on the value in column A, when sorting Sheet1?
The only resolution I could think of is to paste the formula results as values, but the table would not be as dynamic anymore.
Thank you in advance!

I am looking for a method to select a value from Sheet C, match it to a value in Sheet A, and populate C from A

I am trying to auto-populate Sheet C from data using two other sheets in the same workbook. I am using vlookup to get data from Sheet B onto Sheet C (columns D - H). Columns B - C will also use vlookup.
I am having trouble figuring out a way to pull multiple data from Sheet A onto Sheet C based on a single value from C.
When I select a value from 'Sheet C'!A2 dropdown, I'd like to locate the matching value in Column A of Sheet A. When it matches, I'm wondering if it is feasible to pull all the data to the right of the matched value in Sheet A into the corresponding blank spaces of Sheet C.
Sheet C
Sheet A
Expected result if I selected AlbCreERT2 in A2 of Sheet C:
What I am trying to avoid is a workbook with 20 dedicated sheets, one for each particular value (with its data already populated). Any help would be appreciated. I'd also value suggestions for an alternative, even if the alternative is the workbook with 20 dedicated sheets.

Formulas in template to automatically adjust to size of data

I'm trying to make a template in which users can dump data into columns A, B and C.
I'd like for users to be able to have a calculation per row in column D, for example =(A1+B1)/C1.
Is it possible to make it so that users will not need to drag-down-copy the formula in column D to fit their data?
As in, have excel automatically copy the formula in D down to D22 if there's data in A22?
Instead of copying you should put in a formula in column D that checks if there is data in column A for that row and return "" if there isn't.
IF(ISBLANK(A22),"",[your formula])

Resources