Data validation (Drop down) to auto-populate column with formula - excel

I'm trying to make an excel sheet a lot smaller and easier to handle. What i'm trying to do is have a drop down auto-populate a whole column.
My original sheet looks like:
Item Name(A1) Item Code(B1) Price1(C1) Price2(D1) Price3(E1) Price4(F1)
My goal is to look like:
Item Name(A1) Item Code(B1) Price Drop Down(C1)
I also want to be able to delete an item in Column A and still be able to have the correct values. My VLOOKUP only uses 1 column and wont change (of course) when I switch to a different price set.

You could try something like this:
Copy your original table to another sheet (sheet2), so you can use it as the lookup table. In the original sheet delete the last 4 columns (C:F). Next create a dropdownmenu in cell C1, with items {price1 ,price2 ,price3 ,price4}. Put the following formula in cell C2 and copy down.
=VLOOKUP(A2,Sheet2!A:F,RIGHT($C$1,1)+2,FALSE)
The last parameter [FALSE] is necessary when the item names in the lookuptable are not in alphabetical order.

Related

Excel: Convert Column of Duplicates into a New List, AND THEN create into a DROPDOWN LIST

I have a CSV Product Export from Shopify. I am creating a manual offline quote sheet for furniture items.
Column B = Product Title
Column A = Product Title's Handle (obtained using an Index formula)
PROBLEM:
Column D = Duplicates need to be converted into a list.
THEN using above formula add to a new cell for a Drop Down list (Add formula into Data Validation:Source.)
Note based on the image diagram: Ref 'I2' is located far top left where it says 'Aurora Chair 4 Leg'
NOTES,
And this formula is enetered into 'I3',
=XLOOKUP(I2,A2:A16,D2:D16)
.. but, this formula only returns 'D2', not D2:D5
I also unsuccessfully tried,
=indirect(I2,A2:A16,D2:D16)
=XLOOKUP((I2,A2:A16,0)RANGE D2:D16))
=index(I2,A2:D16)
=FILTER(A2:D16,D2:D16=I3)
{=SUM(COUNTIF(A2:A16,D2:D16))}
=COUNTIF(A2:A16,VLOOKUP(I3,D2:D16,1,0))
You can use this formula for a unique list of filtered values:
=UNIQUE(FILTER(D2:D16,A2:A16=I2))
You can't use this formula as a data validation source :-(
Therefore you have to put it somewhere (hidden) on the sheet, e.g. into cell K2.
And then refer to it as K2# in the data validation source.
Edit according to comment:
To show the values in a row instead of column you use:
=TRANSPOSE(UNIQUE(FILTER(D2:D16,A2:A16=I2)))

Return a selection of data based on a filter in another cell

I tried to look but I was unable to find this information anywhere on the site.
I am trying to return a selection of my data that fits a criteria in another cell.
I have a sheet (Sheet1) that has ALL my data in it (around 38000 rows) and I need to filter this on another sheet(Sheet2) for one of the columns in this data. For example, if I wanted to return all members that had a 7 in column P on Sheet1? and return all the columns that appeared in Sheet1 in Sheet2
So far I am trying the INDEX(array,MATCH()) way of working but this is only returning the first person that has a 7 in column P and not each individual member. And if I do it on a line by line basis, there will be gaps in the data where it doesn't match and want them all bunched to the top. (I hope that makes sense)
Sheet1 Sheet2
The results show in Sheet2 is using the following formula:
=INDEX(Sheet1!A:A,MATCH($B$1,Sheet1!I:I,0))
Is this something that can actually be achieved?
Please let me know if I am not clear in anything I have asked.
You're on the right track with INDEX, but you're also right that MATCH will only get you the first result. You need an array formula that will carry through the rows you want to retrieve. Here's a simple example:
To get this, select H2:J21 and enter this as an array formula (commit with Ctrl + Shift + Enter):
=IFERROR(INDEX(A2:C21,SMALL(IF(C2:C21=E2,ROW(A2:A21)-ROW(A1),FALSE),ROW(A2:A21)-ROW(A1)),COLUMN(A1:C1)),"")
UPDATE:
As #OverflowStacker points out, for your example problem, since your table headers are on row 1 and it doesn't look like you would ever have your column header in your lookup column's data, you could use a simpler formula:
=IFERROR(INDEX(A1:C21,SMALL(IF(C1:C21=E2,ROW(A1:A21),FALSE),ROW(A1:A21)),COLUMN(A1:C1)),"")

How to get a dynamic excel sheet out of a list, based on a value of a column

I think I need to solve this with an array formula in Excel, but I am kind of stucked.
Imagine you have an excel sheet (called main_data).
In here you have a list of people and a status for each person.
||Name(Column A)||Age (Column B)||Status (Column C)||
|Albert|10|New|
|Benjamin|20|New|
|Carlos|30|Old|
|Denis|40|New|
Now I want on the second sheet, that only the records are shown under each other that have the status "new". (but actually without showing the status column)
Like this
||Name(Column A)||Age (Column B)||Status (Column C)||
|Albert|10|
|Benjamin|20|
|Denis|40|
A couple of things:
- I do not want to use a pivot table, as the second sheet, which is my required end result, as it must be in a very specific format and order
- I do not want to use an autofilter. (I could add the status column in sheet 2, filter by status new and hide the column. Once I add or remove a record in sheet 1, I have to repeat that filter process)
Any ideas?
Can I do this somehow with an Array formula and add an if condition for the status column?
I tried normal IF function, index / match and Array. but none of them worked as I wanted.
This on sheet 1:
||Name(Column A)||Age (Column B)||Status (Column C)||
|Albert|10|New|
|Benjamin|20|New|
|Carlos|30|Old|
|Denis|40|New|
turns into this on sheet 2, but dynamically, without any user interaction:
||Name(Column A)||Age (Column B)||Status (Column C)||
|Albert|10|
|Benjamin|20|
|Denis|40|
One way is thus. If your source data are in Sheet1
then in Sheet2 put this formula in A2 and copy down and across as far as necessary. Adjust ranges to suit. It's an array formula so confirm with Ctrl+Shift+Enter and curly brackets will appear round the formula.
=IF(ROWS(A$2:A2)<=COUNTIF(Sheet1!$C$2:$C$5,"New"),INDEX(Sheet1!$A$2:$C$5,SMALL(IF(Sheet1!$C$2:$C$5="New",ROW($A$2:$A$5)-ROW($A$2)+1),ROWS(A$2:A2)),COLUMNS($A$2:A2)),"")

Excel - Check if value X and value Y is on the same row

I have an excel document with two sheets, data and edu-plan. The sheet data has the following information:
The sheet edu-plan looks like this:
My question is: how do i create an excel formula that checks if the target group on the specific row in edu-plan! has the course name in question on the same row as the target group in sheet data!, i.e. if Sales and Sales course is on the same row in the sheet data!?
In reality, the data sheet as a couple of hundred rows and will change over time, so i am trying to develop a formula that i can apply easily on all rows/columns in edu-plan!.
The desired result in edu-plan would look like this:
A pivot table might be a good way to go.
If you would like to do it by formula, then you can just use a COUNTIFS
=IF(COUNTIFS(data!$A$2:$A$10,$A2,data!$B$2:$B$10,B$1),"X","")
A possible way to solve your issue with an array formula:
Write in B2 of sheet edu-plan
{=IFERROR(IF(MATCH('edu-plan'!$A2&'edu-plan'!B$1,data!$A$2:$A$6&data!$B$2:$B$6,0)>0,"x",""),"")}
Since it is an array formula, you need to hit shift + ctr + enter.
Here is the formula broken down:
MATCH('edu-plan'!$A2&'edu-plan'!B$1,data!$A$2:$A$6&data!$B$2:$B$6,0)
checks whether the combination of row header and column header is in the data table. MATCH returns the index of the found combination. Since we are not interested in the location, we only ask IF(MATCH > 0, "x", "") to write an "x" if a match was found. If MATCH finds nothing, it returns an error, which is why we add an IFERROR(VALUE, "") around the construct.

Excel: If Cell in Column = text value of X, then display text (in the same row, but different column) on another sheet

This is a confusing request.
I have an excel tab with a lot of data, for now I'll focus on 3 points of that data.
Team
Quarter
Task Name
In one tab I have a long list of this data displaying all the tasks for all the teams and what Quarter they will be on.
I WANT to load another tab, and take that data (from the original tab) and insert it into a non-list format. So I would have Quarters 1,2,3,4 as columns going across the screen, and Team Groups going down. I want each "task" that is labeled as Q1 to know to list in the Q1 section of that Teams "Block"
So something like this: "If Column A=TeamA,AND Quarter=Q1, then insert Task Name ... here."
Basically, if the formula = true, I want to print a list of those items within that team section of the excel document.
I'd like to be able to add/move things around at the data level, and have things automatically shift in the Display tab. I honestly have no idea where to start.
If there is never a possibility that there could be more that 1 task for a given team and quarter, then you can use a formula solution.
Given a data setup like this (in a sheet named 'Sheet1'):
And expected results like this (in a different sheet):
The formula in cell B2 and copied over and down is:
=IFERROR(INDEX(Sheet1!$C$2:$C$7,MATCH(1,INDEX((Sheet1!$A$2:$A$7=$A2)*(Sheet1!$B$2:$B$7=B$1),),0)),"")
I came across this situation. When I have to insert the values into a table from an Excel sheet I need all information in 1 Column instead of 2 multiple rows. In Excel my Data looks like:
ProductID----OrderID
9353510---- 1212259
9650934---- 1381676
9572474---- 1381677
9632365---- 1374217
9353182---- 1212260
9353182---- 1219361
9353182---- 1212815
9353513---- 1130308
9353320---- 1130288
9360957---- 1187479
9353077---- 1104558
9353077---- 1130926
9353124---- 1300853
I wanted single row for each product in shape of
(ProductID,'OrdersIDn1,OrderIDn2,.....')
For quick solution I fix it with a third column ColumnC to number the Sale of Product
=IF(A2<>A1,1,IF(A2=A1,C1+1,1))
and fourth Column D as a placeholder to concatenate with previous row value of same product:
=IF(A2=A1,D1+","&TEXT(B2,"########"),TEXT(B2,"########"))
Then Column E is the final column I required to hide/blank out duplicate row values and keep only the correct one:
=IF(A2<>A3,"("&A2&",'"&D2&"'),","")
Final Output required is only from Column E
ProductID Order Id Sno PlaceHolder Required Column
9353510 1212259 1 1212259 (9353510,'1212259'),
9650934 1381676 1 1381676 (9650934,'1381676'),
9572474 1381677 1 1381677 (9572474,'1381677'),
9632365 1374217 1 1374217 (9632365,'1374217'),
9353182 1212260 1 1212260
9353182 1219361 2 1212260,1219361
9353182 1212815 3 1212260,1219361,1212815 (9353182,'1212260,1219361,1212815'),
9353513 1130308 1 1130308 (9353513,'1130308'),
9353320 1130288 1 1130288 (9353320,'1130288'),
9360957 1187479 1 1187479 (9360957,'1187479'),
9353077 1104558 1 1104558
9353077 1130926 2 1104558,1130926 (9353077,'1104558,1130926')
You will notice that final values are only with the Maximum Number of ProductSno which I need to avoid duplication ..
In Your case Product could be Team and Order could be Quarter and Output could be
(Team,Q1,Q2,....),
Based on my understanding of your summary above, you want to put non-numerical data into a grid of teams and quarters.
The offset worksheet function will work well for this in conjunction with the match or vlookup functions. I have often done this task by doing the following steps.
In my data table, I have to concatenate the Team and quarter columns so I have a unique lookup value at the leftmost column of your table (Note: you can eventually hide this for ease of reading).
Note: You will want to name the input range for best formula management. Ideally use an Excel Table (2007 or greater) or create a dynamically named range with the offset and CountA functions working together (http://tinyurl.com/yfhfsal)
First, VLOOKUP arguments are VLOOKUP(Lookup_Value,Table_Array,Col_Index_num,[Range Lookup]) See http://tinyurl.com/22t64x7
In the first cell of your output area you would have a VLOOKUP formula that would look like this
=Vlookup(TeamName&Quarter,Input_List,Column#_Where_Tasks_Are,False)
The Lookup value should be referencing cells where you have the team names and quarter names listed down the sides and across the top. The input list is from the sheet you have the data stored. The number three represents the column number the tasks are listed in your source data, and the False tells the function it will only use an exact match in your putput.

Resources