Assign values to name in excel - excel

How can I assign a value to a name in excel that i could easily fill out same value to a name but in a different sheet. I know I could do in in python with openxlm lib but as it is my computer from work I can't install anything, even python. My database is very long and I have more than 10 sheets to fill out. Names doesn't appear in every sheets therefore i can't just copy and paste whole column with values
.

This is really quite easy: I have created two sheets ("Sheet1" and "Sheet2"), I filled both sheets as you have shown, and in the "VALUE" column of "Sheet2" (D2, I mean), I have filled in following formula:
=VLookup(A2;Sheet1!$A$1:$D$6;4;FALSE)
Some explanation:
A2 stands for the first entry, which is searched (by this I mean "John", the first entry in the "Name" column in "Sheet2").
Sheet1!$A$1:$D$6 is the table, where I am searching in. It is crucial to use the dollar-signs, as, when you drag your formula down, the first reference will change (A2 will be come A3, A4, ..., but $A$1:$D$6 will not, you will always continue searching in the same table).
4 means that the fourth column of the searched table will be shown (the "VALUE" column in "Sheet1").
FALSE means: do not use approximative search, but use exact one.
Now you can drag that formula down, until the end of your "Sheet2".

Related

Excel: Extract data from well beneath unique identifier

I have a spreadsheet full of data (simplified example below) that I would like to extract the number in the well underneath of "Gimme the number" and paste it into a new column on a separate sheet (i.e. if "Gimme the number" is in G6, I would like to retrieve the value for G7). I do not have access to Excel VBA and have not used macros in the past. I found some examples linked below, but, from what I understand, they would return "Gimme the number", or "Gimme" not 19, 20, and 21. I am not sure if a pivot table is appropriate, because I only want information from a single column. I will only have up to 11 values to extract at any given time, so I think a formula would do it. I am just having a hard time coming up with one that works. Any help would be greatly appreciated!
Search for a text string and return multiple adjacent values
Return multiple matches with wildcard vlookup
I am not sure I get the question well, but I try.
First add a column right of the column with "Gimme..." values. Name it e.g. "Next_value" in the first row. Put in the formula referencing previous column next row. If "Gimme..." is in the cell (for instance) E6, than your formula in the cell F6 is =E7. Copy that formula into the whole Next_value column.
Than select area of these two columns (Label, Next_value) and apply the filter from the Data toolbar. Use the small buttons with triangles at the top of the column Label to adjust the filter so only "Gimme..." rows are filtered.
Now, copy values of Next_value column where you like. If you want just the references, use Paste special function from the Home toolbar and click Paste link button.

Function in VBA for multiple filter

Can someone help me write VBA function to get data from another worksheet using multiple filter?
Data looks something like this.
I want to write a function that extract the A1 or A2 or A3 value based on the dropdown I select. If I select A3 it should pick data from A3 column. My Filter criteria on other columns are Item, id and location. Column for Item, id and location are static. While column for A1, A2, A3 are dynamic. I want to put criteria on Ite, id and location. These are the three criteria and result should be from the fourth column. i.e. either A1 or A2 or A3 based on what I select.
I tried but couldn't figure out. Can someone help me on this, please?
You don't need VBA for this but you do need to make a few preparations. I will show here what I did. There are other ways and you can choose the way you prefer.
I created a table exactly as you posted. Instead of a table you can just create a named range or you can replace the names of either in the formulas with the range's coordinates. I didn't name the table but recommend that you do if you use a table. In my example the table's name is Table1.
Within the table I created a named range comprising the cells D1:F1. I called this range "Data" but any other name will do as well. You may also move the named range entirely elsewhere if you want different captions for the columns for one reason or another. As you will see, the names are insignificant they are used to create the numbers 1, 2 and 3 from the location where they are within the named range Data.
Now I created a validation drop-down referring to a List of =Data. The effect is that I have a drop-down with A1, A2 and A3 in it. I created this drop-down in A10 of a different sheet from the one on which I have Table1.
Now I used the following formulas to extract data from row 2 of the table.
=INDEX(Table1[Item],2)
=INDEX(Table1[Location],2) or =INDEX(Table1,2,3) and
=INDEX(Table1,2,3+MATCH(A10,Data,0))
Observe that every "2" in the above formulas refers to the 2nd row in the named range Table1. I didn't set up a range of that name but that is something Excel threw in when I created the table. However, you would like to pull data from other rows as well.
For that purpose you can use the ROW() function. This function returns the number of the row in which it resides. If it's in row 10 it will return 10, in row 11 it returns 11 etc. It's a counter. Therefore, if you entered my formulas in row 10 you can replace all the "2"s with Row()-8 and as you copy up or down you will get data from different rows, same columns.
=INDEX(Table1[Item],Row()-8)
=INDEX(Table1[Location],Row()-8) or =INDEX(Table1,Row()-8,3) and
=INDEX(Table1,Row()-8,3+MATCH(A10,Data,0))
If your first formula isn't in row 10 you must adjust the number to be deducted according to where your formula was entered.

Row Number In Formula Not Counting When I Drag

I have the formula below that I'm using to link to a certain sheet and cell in my workbook that contains a graph for each entry. On the sheet I link too, each graph is about 20 cells down from the previous one. I have over a 100 graphs now and it will grow in time so I was trying to use the HYPERLINK formula rather than the Hyperlink button for this. I thought I would be able to just insert the formula in the first row, paste it in the second row with an added 20 cells, highlight the two and drag it down but it will not count in increments of 20.
Is this even possible?
=HYPERLINK("#'Trends'!A25","Click To View Trend")
I'm thinking you will have to use some type of concatenation to get the behavior you are after. To do this, you may want to employ a "helper" column. For example, put the "numbers" you are after in column B -- below you will see that I incremented it by 5.
Now your HYPERLINK formula in cell A1 is written as:
=HYPERLINK("[Book1]Sheet2!A"& B1,"Click Me for Sheet2, Cell A"&B1)
(Assuming the workbook is called Book1. Now, I can drag that formula down and it will update "dynamically" to account for the changes in column B.

How can I search across Excel sheets?

I want to transfer data automatically from 2 sheets to one single combining one. That means I have 2 different export sheets (called 'Te_open' and 'Te_closed') that contain both the columns "Problem" (in different positions, can vary always). I have one sheet, that represents an overview of the data from the two other export sheets. So when I have for example the value "Te1" in the cell A2 of my overview sheet, I want Excel to search in the two export sheets the value "Te1" and give back the value in the same row as "Te1" but of the column "Problem", so that I can fill the cell B2 where I want to have the Problem type. So I thought I might need the "MATCH" formula, to let excel know I want to search the column with the headline "Problem" in the export sheets, to fill the column "Problem" in my overview sheet.
The problem that I see is that I have to search TWO sheets and I don't know in which one the "Pm1" will appear. Furthermore I don't know in which column of the sheet "Problem" will appear.
Can you please help me? I would preferably like to solve the problem with a formula, not a macro. Thank you very much in advance.
Kind regards,
question
To find the index of the first column in one of your sheets that is headed 'Problem', you can use (e.g.):
=MATCH("Problem",Te_open!$1:$1,0)
Let's assume we place that formula in a cell somewhere and name the cell open_col. To find a value in column A of Te_open and return the corresponding value from the 'Problem' column, you can then use:
=VLOOKUP(A2,Te_open!$A$2:$Z$999,open_col)
Note that you'll have to define the search range to include the largest range that your data on Te_open could occupy. If the search value is found this will return the corresponding value from the 'Problem' column, otherwise it'll return #N/A. So if you've also set up a cell called closed_col to get the column index for the Te_closed sheet, you can do:
=IF(ISNA(VLOOKUP(A2,Te_open!$A$2:$Z$999,open_col)),VLOOKUP(A2,Te_closed!$A$2:$Z$999,closed_col),VLOOKUP(A2,Te_open!$A$2:$Z$999,open_col)
That gets the result from the correct column of Te_open if the search value was found there, otherwise it gets the result from the correct column of Te_closed. If neither sheet contains the search value it'll return #N/A.

Excel 2007 update reference when copying a row to another spreadsheet

I have two pre-filled spreadsheets ('main data' and 'variable prices') and VBA code that formats and copies one row from 'main data' to a 'results' sheet using some values from 'variable prices'.
On the first sheet a certain value is calculated using a cell in, say, BR column, when row is copied to the 'results' sheet that value is moved to another column, BY.
Something terrible happened and now the formula that calculates total on the 'results' is not updated and takes irrelevant value from BR column.
How to manually (I am guessing that when I put this together half a year ago the reference was updated automatically, but got destroyed when my boss edited/copied values or whole rows of data from other files, deleting the files after - I get "broken link" message now) set it back?
I hope this is legible. This is my only VBA experience, its operation is still somewhat of a mystery..
Thank you!
When you copy data as a formula and you want to keep referencing parts to the originating column/cell, you can "lock" the references. Example in a cell:
=A1, when copied two columns to the right would result in =C1 or
=A1, when copied tow rows down would result in =A3.
You can fix/anchor either the column, or the row or both in a formula by putting a $ in from of the reference. =$A1 remains =$A1 even when copied two columns to the right. =A$1, remains =A$1, even when copied two rows down. =$A$1 will always stay =$A$1, wherever you copy this to.
Alternatively, if you only want the value (not the formula), use paste.value or
cells(ref.target).value = cells(ref.org).value.
Oh forgot to tell you, when you highlight a cell address (A1) and you press F4, you can toggle between 4 stages from $A$1, $A1, A$1, A1

Resources