I have an excel workbook with two worksheets.
On one sheet I have data horizontal and my second sheet I have data vertical.
I want on sheet 2 to drag down my reference from sheet 1 data.
I am looking to have column increase not my row increase? Makes sense?
I try to "equal" the cell i want from sheet 1. However when I drag down my reference goes down instead of across.
Any help would be appreciated.
Conceptually: Use Index. The syntax is Index(range,row number, column number)
If you want to transpose a range in Sheet1 to Sheet2, you can use
=Index(Sheet1!$A$1:$J$10,column(A1),row(A1))
Copy across and down.
See how the row argument uses the column command and the column argument uses the row command. That means in the starting cell A1, the INDEX formula will return the column number 1 for the row argument and the row 1 for the column argument, i.e.
=Index(Sheet1!$A$1:$J$10,1,1)
Copy the formula to row 2 and the reference in the column argument will refer to Row(A2), so the formula will translate to
=Index(Sheet1!$A$1:$J$10,1,2)
i.e. it will return the value from the second COLUMN of the index range. See the screenshot for a result. Change the Index range to your desired source.
Related
I have a worksheet where I need to fill in data referenced from other worksheets.
I need to match a value on my main sheet with one on another sheet and once the cell has been found I need to get the value of a different cell offset by 1 row up and 5 columns left. I know which columns I need but I need MATCH to return the initial row.
MATCH will give me the initial row that I need.
ADDRESS means I can build the cell reference.
OFFSET allows me to reference another cell if I have the original cell address.
However the ADDRESS function will only return the address as a text string and not as a reference that can be used in the OFFSET formula.
Does anyone know of a way to make this work?
Kind regards
Matt
If the value on your main sheet is in cell Sheet1!A1, and the matching value is somewhere in column Sheet2!J:J.
The MATCH formula will return the row number:
=MATCH($A$1,Sheet2!$J:$J,0)
You want one row up from this so the formula will be:
=MATCH($A$1,Sheet2!$J:$J,0)-1
Make sure this does not fall below 1
To return a reference to another cell you'd use INDEX as this is non-volatile and won't try and recalculate unless you change a figure it uses.
It returns a reference to a cell given a range of cells, a row number and a column number.
Your column is always five columns to the left, so if you're matching in column J you want a figure from column E.
e.g. If you want row 5 from column E you'd use =INDEX($E:$E,5).
Replace the row number with your Match formula and you get the figure you're after:
=INDEX($E:$E,MATCH($A$1,Sheet2!$J:$J,0)-1)
As the title suggests, I have a worksheet (sheet1) that has lots of data that spans columns A-E and with rows that are added daily, What I want to do is on a separate worksheet (sheet2) show the data from the last 5 rows of sheet1.
Providing there is continuous data within column A on Sheet1, you could also use the INDIRECT() and COUNTA() functions.
=INDIRECT("Sheet1!$A$"&COUNTA(Sheet1!$A:$A)-4)
=INDIRECT("Sheet1!$A$"&COUNTA(Sheet1!$A:$A)-3)
=INDIRECT("Sheet1!$A$"&COUNTA(Sheet1!$A:$A)-2)
=INDIRECT("Sheet1!$A$"&COUNTA(Sheet1!$A:$A)-1)
=INDIRECT("Sheet1!$A$"&COUNTA(Sheet1!$A:$A))
You would need to amend the column letter within the INDIRECT function for each column of data which you wish to view on Sheet2.
In an appropriate cell on Sheet2, use this formula,
=INDEX(Sheet1!A:A, MATCH(1E+99, Sheet1!$A:$A)-(ROW(1:1)-1))
Fill right for a total of 5 columns then fill those 5 cells down 5 rows.
That formula will find the last number in a column. This is often the case as the left-most column mat hold an ID number. The same reference point should be used to collect cell values from other columns to avoid the confusion that a rogue blank cell would create.
If all you have are text values then the formula in the first cell would be,
=INDEX(Sheet1!A:A, MATCH("žžž", Sheet1!$A:$A)-(ROW(1:1)-1))
Fill right and down as described above.
I am working on a formula that delivers text from a cell in another sheet, that is to the left of a matched cell. This is as far as I have got.
=LOOKUP(A2,Sheet1!$A$1:$A$46729,Sheet1!$B$2:$B$46729)
In sheet 1 there is a selection of product data. There are product numbers in column A and there needs to be the correct barcode placed in each cell in column B. In sheet 2 there are also product codes in column A and barcodes in column B. However there are significantly more rows of data in Sheet 2.
What is needed is a formula to place in Sheet1!B2 that looks up Sheet1!A2 in Sheet2!A2:A50000. If A2 is matched at e.g. Sheet2!A90, then the result in Sheet1!B2 should be the value in Sheet2!B90. The specific issue I am having is getting the Sheet2!B90 in Sheet1!B2.
You can use Index/Match:
=Index(Sheet2!$B$2:$B$46729,Match(A2,Sheet2!$A$2:$A$46729,0))
Or VLOOKUP:
=VLOOKUP(A2,Sheet2!$A$2:$B$46729,2,false)
The last parameters of the MATCH and VLOOKUP functions respectively are very important as it forces it to search for an exact value and not assume a sorted list. VLOOKUP would no longer work if you reversed columns A and B on Sheet2 because the lookup column has to be the first column in the lookup range.
I have two excel sheets. The one that contains the data "gdsc_en_input_w2" and the other one will contain a selective number of cells from "gdsc_en_input_w2".
I am using the current formula:
=INDEX(gdsc_en_input_w2!$A$1:$YE$13848,MATCH("AKT2",gdsc_en_input_w2!$A$1:$A$13848,0),MATCH($A$3,gdsc_en_input_w2!$A$1:$YE$1,0))
I want to fill an entire column in the second sheet by referencing columns in the "gdsc_en_input_w2" sheet but based on the values stored in the column $A$1:$A$13848. As you can see the second match() matches only $A$3 ...is there a way to fill the required column with the formula with incremental column reference in the second match() function in the formula above. in other words I want to fill in the second cell of the target column the following formula :
=INDEX(gdsc_en_input_w2!$A$1:$YE$13848,MATCH("AKT2",gdsc_en_input_w2!$A$1:$A$13848,0),MATCH($A$4,gdsc_en_input_w2!$A$1:$YE$1,0))
note that the match now has $A$4 instead of $A$3.
Assuming that I am understanding what you are wanting, this formula is going to be in one column where each subsequent row will have a higher number (3,4,5,...) If that is the case, unlock your formula to read:
=INDEX(gdsc_en_input_w2!$A$1:$YE$13848,MATCH("AKT2",gdsc_en_input_w2!$A$1:$A$13848,0),MATCH($A3,gdsc_en_input_w2!$A$1:$YE$1,0)) (I removed the $ in-front of the 3)
Paste that into the whatever your starting cell is, then auto-fill
I have a column of data in say A1:A10 in worksheet A. In worksheet B I have a range for data from A1:J1. I need the data from the column in worksheet A to be transposed into the data range in worksheet B. I can Paste Special and paste in the values but I need the information in worksheet A to update automatically that in worksheet B.
Any help or advice is appreciated.
Please select A1:J1 in worksheet B and enter:
=TRANSPOSE('worksheet A'!A1:A10)
with Ctrl+Shift+Enter.
Copy this:
=INDEX(A!$A$1:$A$10, COLUMN())
into your cells A1 through J1 in worksheet B (so that all cells contain the exact same formula).
Basically, the INDEX function grabs a specified element out of your vertical array A1:A10 in worksheet A (the worksheet name is specified before the exclamation point). Which element to choose is given by the second parameter. Here, we simply use the COLUMN() function, which returns 1 for column A, 2 for column B and so forth...
EDIT:
If you want to use a different data column as the source of your data, simply replace the A!$A$1:$A$10 with anything else you like, e.g. Sheet3!$C$10:$C$23.
To place the copied data somewhere differently, copy the formula above into all the target cells, wherever they may be. BUT: If the target cells do not start in column A, you need to subtract an offset from the number returned by COLUMN(), so that you pick element 1 in your first target cell. So, for example if you want to place the data into cells J5 through S5, you will need to copy this formula into each cell:
=INDEX(A!$A$1:$A$10, COLUMN() - 9)
This is because COLUMN() returns 10 for column J, but you want that cell to contain element 1 of your source data column, so we subtract 9 to get from 10 to 1. In column K, COLUMN() will return 11, subtracting 9 yields 2, so INDEX(...) will then return the second data element for that cell, and so on.