I'm working on a three sheet Excel spreadsheet that needs to be "idiot-proof" (Someone chooses an option from a drop-down menu and the formula fills itself in).
So in the first sheet, there are lists of ratios that are used to look things up in tables located in the second sheet; the locations those tables are associated with the drop-down list.
Here's where it gets fun: the new piece I'm adding in the second sheet has 5 tables associated with it. So one ratio from the first sheet picks the table, and another one is used to interpolate on that table. The third sheet is being used to store the calculated table location - Match() is used to pick the table, nested if statements to get the row number associated with it. I used Address() to get the actual location in sheet 2 listed in sheet 3.
I need an array in my interpolation function, being in the first sheet. I've been trying anything to get the same result using formulas as if I went to sheet 2 and physically selected the boxes I need. What looks most promising so far is Index().
D31 in sheet 3 contains the address of the upper left of the table in Sheet 2, and G31 has the bottom right.
INDEX(Sheet3!$D$31:Sheet3!$G$31,0,1)
http://office.microsoft.com/en-us/excel-help/index-function-HP010342608.aspx
The thing is, this is giving me the items in Sheet 3 as the array, and still not letting me access Sheet 2 from that.
Does anyone have any ideas? I've run completely out. Thank you in advance for any help :)
Related
What I would like to achieve is that sellers can choose the STORE in the blue cell (either with a drop down list or by hard-typing the STORE name) and, based on the selection on the blue cell, the available POSITIONS for that particular PRODUCT and that particular STORE are show in the green cell as a drop down list.
Let's say I have an Excel workbook, which contains a worksheet with this table with products data, which is automatically imported daily from our Nav server with this layout. It has 4 columns including PRODUCT CODE, DESCRIPTION, STORE IN WHICH IT CAN BE LOCATED and POSITION INSIDE DE STORE (please, check screenshot). It contains 1.5k rows and it changes dynamically, for example, new items are added or positions are exchanged.
As you can see, the same product (PRODUCT 2) can be located in several stores (STORES 1, 2 and 3), and it can be in several locations on each store (POSITIONS 2, 3, 1 and 4).
Now I need sellers to report which of these items they pick and from where, not only the STORE but its POSITION inside the store too. They do it with another worksheet inside the same Excel workbook. It looks more or less like this (please, check screenshot).
I know the drop down list is achieved via Data Validation but I can't figure out the formula for this. I have tried several approaches like:
Array formula to return all POSITIONS in the same ROW, following this (Formula 2.): https://www.ablebits.com/office-addins-blog/2017/02/22/vlookup-multiple-values-excel/. It is quite slow to calculate on the 1.5k items and, once done, I can't figure out how to make Data Validation to look for the 4 or 5 or 10 POSITIONS returned by the array formula, which also need to be filtered by STORE (please, check screenshot for the closest that I have been, array formula returning POSITIONS from column E).
Same formula as above directly on the Data Validation list box, which returns only the first POSITION found.
VBA custom fucntions which are not allowed in the Data Validation box.
I feel comfortable with both Power Query and VBA, and forumla as well, and can adapt most of the code I see but I don't know why I just can't figure out how to achieve this, maybe it is only I am blocked or something but every path I start to follow ends up in a dead end.
Does anyone have an idea on how to approach this? It doesn't really seem that complicated but it is becoming impossible for me.
Thank you very much for your time!!
This is what I have finally done, just in case someone else is facing this situation.
Instead of a plain-text table for the POSITIONS, I created a PowerQuery importing that CSV. Named that worksheet _LOCATIONS.
Added a custom column (Column E) combining the PRODUCT and the STORE so I had something like a Unique Identificator, resulting something like this but in PowerQuery.
Combined column:
Sorted column E and sub-sorted column D, so I make sure the list will always be ordered as I need, and saved the query.
Then, in worksheet REPORT, I entered this formula to create the drop down list in Data Validation in cell D2:
OFFSET(_LOCATIONS!$D$1,MATCH($A2&"-"&$C2,_LOCATIONS!$E:$E,0)-1,0,COUNTIF(_LOCATIONS!$E:$E,$A2&"-"&$C2))
And I am able to choose from the available POSITIONS for the selected PRODUCT in the selected STORE.
Brief explanation:
I set the reference for the OFFSET function in the very first POSITION (D1), and then I move it the amount of rows detected by the MATCH function (which searches for the "PRODUCT 2-STORE 2" string in the newly created combined column) minus 1 (PoweryQuery table has headers) and 0 columns. This leaves me on the first occurrence of my string (but on the POSITIONS column). Then I make the offset as high as the amount of rows detected by the COUNTIF function (which counts all occurrences of my PRODUCT-STORE pair), returning an array of all the positions (column D) matching the PRODUCT-STORE pair.
Ask for formula in Spanish if you need it.
Is there a way in excel to copy the contents of one column to another sheet based on particular values in another column.
I have data which looks like this:
Sheet1:
Sheet2:
I would like to copy the column A of sheet 1 directly onto column A of sheet 2, but only if the value in column B is Y.
I have tried used the match function but am not sure how the best way to do this would be. Is there a way for me to achieve this?
My desired output is:
As discussed in the comments, #Waldorf99 was looking to have a second worksheet that would automatically show a filtered list from the first sheet. I can think of a few ways to do this (array formulas or pivot tables come to mind). The problem with mixing dynamic columns with static values is that the static values would become desynced from the dynamic ones.
In the original example, rows may have a blank value in the condition column in sheet one, and then may be assigned a Y or N at a later date. If a Y is assigned to a row in the middle of other rows, the filtered sheet would shift the existing rows down to make room. The static values would stay where they were, and would become desynced. To demonstrate:
If the above image is the original state of sheet 1 and 2...
...adding a y next to x.1.c would result in sheet two shifting columns A and B of row 2 down, but leaves columns C and D behind (as they are static, and not tied into the first two columns in any way).
One thing that may work as you are wanting are filters. You would only have one sheet, with all of the data manually entered. Then you can add filters, and change them to hide rows temporarily when needed.
To add and use filters:
Start with your data all on one sheet...
Highlight your data...
On the Home tab, select "Format as Table" and choose any style...
This turns your data into a table. You can filter by clicking the drop down in a given columns header row, then deselecting the values you want to hide.
The results are a table that only shows the rows with a 'Y'.
The other rows aren't removed, just hidden. You can always reset or change your filters, to configure which rows are visible.
Note: when working with tables, they will auto expand to account for new rows, so long as you work in the row directly under the table (e.g. don't leave blank rows). You can also manually resize the table at any time by clicking and dragging from the bottom right corner of the table.
There are tons of resources of Excel tables online, and it's a pretty useful tool in Excel.
Hope that achieves what you were looking for.
I have a report that consists of 3 different input, and 3 corresponding output tabs for 3 different sources of information. Each source needed a Macro to change the formatting of the data. One of these sources needs data for individual days, so as it formats the data into a table, it is copying and inserting the cells on top of the previous day's data. Once 5 days of data has been converted and stacked in the output tab, a final tab has essentially all the formula's, dubbed the "Conversion" tab. In this tab there are 3 tables for each source of data (the output tabs) and a fourth that takes the data from these 3 tables, and combines them into what a final macro copies and pastes the values from into a new sheet.
The problem lies in that sheet that stacks the data by inserting the new rows. I've done everything from Index and match, Offset and match, simple offset, Vlookup (obviously, that's the go-to at first) and even Defined the name of new formula's, but the cell that the Conversion tab's table references keeps moving down as new data comes in. I need to reference Array 'CampPerf Output'!B116:B135
no matter what. What formula can I use or backdoor trick can I use so that my lookup looks at the exact same array every time?
The macro that converts the data has to be a repeatable action so I can assign it to a button (This report must be made as simple as possible, as Non-Excel Users need to be capable of "paste data, click button, click other button, ta-da!")
Thanks for any help!
Use this as your range reference:
INDEX('CampPerf Output'!$1:$1048576,116,2):INDEX('CampPerf Output'!$1:$1048576,135,2)
This will always return the range array in 'CampPerf Output'!B116:B135 no matter how many rows or columns are added or removed.
I will have a defined number of identical workbooks within excel for each member of staff, at present this is 3. I want to have a master workbook where I can consolidate the data from all 3 workbooks. If there was a defined number of inputs I could obviously just copy and paste the data over or use a macro to make it seem more 'live'. However, it will be unknown how many inputs each member of staff will have and the only way I could imagine doing it is by the following equation (however I would use the workbook reference):
=IF(Sheet1!A1<>"",Sheet1!A1,IF(Sheet2!A1<>"",Sheet2!A1,IF(Sheet3!A1<>"",Sheet3!A1,0)))
However, when you drag the formula down it will give the obvious problem of putting the value of Sheet2!B13 in the 13th cell if there were only 12 inputs in SheetA, I would need to know the final value of the first sheet to reference the second sheet - but they are dynamic.
Any help would be appreciated.
If you want to find the last row of an area by a formula in Excel;
You need Table:
Select your area.
Click on Formats as Table from Home→Styles, and select one of then
Now you have DESIGN tab that you can see the Table Name like Table1.
Now, you have a table and by this formula you can find number of rows of your table:
=ROWS(Table1)
And by this formula you can find number of columns of your table:
=COLUMNS(Table1)
And when you want to know its value try this (The final value):
=INDIRECT(T(ADDRESS(ROWS(Table1)+1; COLUMNS(Table1)))
NOTE : By using Tables you Don't need to specify your sheet.
Right I've spend all day looking / trying to find something that could do this, could someone please point me in the right directions please.
please note im using office 2013
I have a Drop down list on Sheet 2 which pulls data from sheet 1 and then changes the values on sheet 2 by using Vlookup, depending on what has been selected from the drop down list.
However there is a variably column on sheet 2 that needs to be changeable which effects one of the Vlookup points of from sheet 1.
so i was thinking for example
IF sheet1A2 = sheet2A2 Then sheet2b2 = sheet1b2
therefore saying if the two drop down values on both sheets match then output the same value in the same row on sheet 1, therefore allowing the data to move up and down the column on sheet 1 depending on what has been selected on sheet 2.
I've not done VBA and excel in ages so very rusty btw
Thank you for the Help.
I have managed to fix it thanks anyways.=IFERROR(VLOOKUP($A12,'Proposed Rations'!$A$2:$J$15,MATCH($P$1,'Proposed Rations'!$A$1:$J$1,0),0),"")" was the item that i needed.