I have the following data in spreadsheet A.
name trait1 trait2 nice
0 Adam 29 81 0
1 Barry 17 75 1
2 Chris 62 0 1
I wish to create a spreadsheet B that will be a filtered copy of this data. Namely, let's assume for a moment that I want to filter nice = 1 and am interested only in column name. The copy in spreadsheet B would be as shown below. In spreadsheet B I wish to be adding some extra columns, e.g. education.
name nice education
1 Barry 1 primary
2 Chris 1 university
What I want to achieve is a spreadsheet B that will get updated if anything changes in spreadsheet A. So for example, if I were to change the name Barry to Ben. The spreadsheet B would become the following.
name nice education
1 Ben 1 primary
2 Chris 1 university
Similarly (and what I find to be the hardest), if a row is added in spreadsheet A, e.g.
name trait1 trait2 nice
0 Adam 29 81 0
1 Barry 17 75 1
2 Matt 69 11 1
3 Chris 62 0 1
The updated spreadsheet B would be as follows:
name nice education
1 Barry 1 primary
2 Matt 1
3 Chris 1 university
So I want the education column to remain the same.
My approach of using a combination of =IF() and =VLOOKUP() functions ultimately did not work. Guess I am really curious about how to connect rows of education to names. So that when a row is added in spreadsheet A, then spreadsheet B gets updated but the education field connected to the new row is empty and will be filled by hand later on.
Since you are looking for a finished product to be in Google Sheets, I'd advise to use QUERY():
Formula in I1:
=QUERY(INDEX({A:D,VLOOKUP(A:A,F:G,2,0)}),"Select Col1,Col4,Col5 where Col4=1")
Note: I made the assumption you pull the education in through a VLOOKUP() (since you mentioned that in the body of the question).
Related
I'm trying to compile a best 5 and worst 5 list. I have two rows, column B with the number score and column C with the name. I only want the list to include the name.
In my previous attempts the formula would get the top/bottom 5 but as soon as a duplicate score appeared the first known name with that value would just repeat.
Here is my data
26 Cal
55 John
55 Mike
100 Steve
26 Thomas
100 Jaden
100 Jack
95 Josh
87 Cole
75 Brett
I've managed to get the bottom 5 list formula correct. This formula works perfectly and includes all names of duplicate scores.
Example of what I get:
Cal
Thomas
John
Mike
Brett
=INDEX($C$56:$E$70,SMALL(IF($B$56:$B$70=SMALL($B$56:$B$70,ROWS(E$2:E2)),ROW($B$56:$B$70)-ROW($B$56)+1),SUM(IF($B$56:$B$70=SMALL($B$56:$B$70,
ROWS(E$2:E2)),1,0))-SUM(IF($B$56:$B$70<=SMALL($B$56:$B$70,ROWS(E$2:E2)),1,0))+ROWS(E$2:E2)))
Here is the formula I've tried to get the top 5 - however I keep getting an error.
=INDEX($C$56:$E$70,LARGE(IF($B$56:$B$70=LARGE($B$56:$B$70,ROWS(E$2:E2)),ROW($B$56:$B$70)-ROW($B$56)+1),SUM(IF($B$56:$B$70=LARGE($B$56:$B$70,
ROWS(E$2:E2)),1,0))-SUM(IF($B$56:$B$70<=LARGE($B$56:$B$70,ROWS(E$2:E2)),1,0))+ROWS(E$2:E2)))
Example of what I'm looking for
Steve
Jaden
Jack
Josh
Cole
You can set two queries like this for both cases:
=QUERY(B56:C70,"Select C order by B desc limit 5")
=QUERY(B56:C70,"Select C order by B limit 5")
Use SORTN() function like-
=SORTN(A1:B10,5,,1,1)
To keep only one column, wrap the SORTN() function with INDEX() and specify column number. Try-
=INDEX(SORTN(A1:B10,5,,1,1),,2)
Considering the following data :
sheet1 (customers)
A
0 customer_name
1 john
2 kevin
3 mickael
sheet2 (products)
A
0 product_name
1 book
2 ball
3 game
sheet3 (orders)
A B
0 customer_name product_name
1 john book
2 john game
3 mickael ball
I would like to know for each combination of customer and product if an order has been ordered and display it in the sheet1 to get something like that :
sheet1 (customers updated )
A B C D
0 customer_name book ball game
1 john 1 0 1
2 kevin 0 0 0
3 mickael 0 1 0
I know how to do that with "code" (by doing a macro in vba or a small exe in c# that will update the file), but I want to do it (if its possible) by just setting a formula inside my sheet (fyi, I can put the 3 inputs in the same sheet if needed, that's not a constraint
Updated :
with the previous configuration described, I have put the following formula in sheet1 B2 : =COUNTIFS(Sheet3!$A:$A;$A2;Sheet3!$B:$B;B$2), and when running the formula and extending it to every cell in my sheet I am getting everywhere the value #NAME? (I've translated if from french so I am not sure if its the right error in english). I think where I am making a mistake is that I am not using sheet2, how can I say first to "do all the combinations possible of customers insheet1 and products in sheet2 and look for those combinations in sheet3, knowing that I am in sheet1 and that I want to display the result like aking before?
Use COUNTIFS:
=COUNTIFS(Sheet3!$A:$A,$A2,Sheet3!$B:$B,B$1)
I have two sheets in Excel workbook.
The first sheet has
1) Customer ID – unique values for each customer.
2) Question ID – unique id for each question
3) Questions
Customer ID Question ID question
1 34 name
1 45 company
2 34 name
2 45 company
3 34 name
3 45 company
4 34 name
4 45 company
5 34 name
5 45 company
The second sheet has three columns
1) Customer ID – unique values for each customer.
2) Question ID – unqiue id for each question
3) Questions
Customer ID Question ID Answer
1 34 Amy
1 45 GEICO
2 34 Steph
3 34 Anna
3 45 GEICO
4 34 Adam
5 34 Mark
5 45 AAA
In this sheet, not every customer id and Question ID in sheet one will have answers in the sheet 2
Sheet 3 Expected Output
I wanted to do a vba macro to combine both sheet1 and sheet2 and have all the columns. For any customer id, if there is no answer for a question, that field should be left blank.
Expected Output in Sheet3
Customer ID Question ID question Answer
1 34 name Amy
1 45 company GEICO
2 34 name Steph
2 45 company
3 34 name Anna
3 45 company GEICO
4 34 name Adam
4 45 company
5 34 name Mark
5 45 company AAA
There are several ways this can be done without writing code.
Below is one method off the top of my head. Others include the built-in query editor (Get & Transform), or PivotTables and others ways to consolidate data in multiple worksheets.
On Sheet2, first set up a "helper column" since there are multiple columns you want to match. In this example the formula is: =C2&D2 starting in Cell B2.
...then, in Sheet1 (cell E2 in the example), use a formula like:
=IFERROR(VLOOKUP(B2&C2,Sheet2!$B$1:$E$9,4,FALSE),"")
Both formulas get copied or "dragged" down as far as necessary and obviously the formula adjusted to refer to the correct cells.
No third worksheet is necessary but if you want you can start by copying Sheet1 to Sheet3.
More Information:
Microsoft Support : VLOOKUP Function
Microsoft Support : Lookup & Reference Functions
Microsoft Support : IFERROR Function
My Excel sheet contains columns for id, date, amount and name.
If two or more rows have the same id and name I want to merge them into one row with the amount of those two combined. Can anybody help me doing this?
Use concatenation with Columns ID and NAME (=ID&NAME) in another column and look for the pivot table. Move to Insert->Pivot table option to get the attached answer]
Hope this clarifies
Here is a possible solution (as far as I understand the problem) using a PivotTable:
As you can see, there is not really much to it. Just insert a pivot table and drag the ID & Name to the Rows while you move the dates and the values to the Values section of the pivot table. The Values in the Column section will be automatically generated.
The only thing I changed at the end was to format the pivot table nicely doing the following:
Remove SubTotals by name
Using a PivotTable style that I like from the PivotTable menu in the section Design.
Show items in a tabular format. That means that the name and the ID are shown on one row and not in a cascading format (ID in one row and the name in a second row underneath + indented). You can achieve this by right-clicking on the name and selecting Field Settings. A new window opens (showing the settings). Go here to the Layout & Print tab and select Show item labels in a tabular form. You might have to repeat that for the field Name and the field ID (depending on which of the two fields you chose to show first in the Rows section of the PivotTable).
Let me know if this solved your problem or if you have any questions.
Note: since no sample data has been provided I made some up. I sure hope this data is somewhat similar to what you are trying to aggregate.
Used sample data:
ID Date Amount Name
1 05.03.2015 121 Peter
2 14.01.2015 127 Max
3 11.01.2015 77 Eva
4 06.11.2015 141 Jamie
5 04.03.2015 58 Sophie
1 04.04.2015 94 Peter
7 20.06.2015 52 Lucas
3 14.12.2015 136 Eva
2 02.11.2015 93 Max
10 20.08.2015 59 Mason
4 11.01.2015 145 Jamie
4 02.02.2015 113 Jamie
4 26.02.2016 89 Jamie
1 30.03.2016 137 Peter
15 09.09.2015 81 Jackson
16 25.02.2015 61 Liam
2 26.02.2016 133 Max
2 26.10.2015 80 Max
19 25.09.2015 76 Aiden
I couldn't find anything similar.
I have a pretty big excel table but I can't get what I need from it.
I have a column for example of names
John
Johnny
Arny
Arny
John
Johanatan
Jeremie
Brook
Arny
Johanatan
I want it to return or show me results like that
Johnny 1
Arny 3
John 1
Jeremie 1
Brook 1
Johanatan 2
Couldn't find an appropriate excel to result me with that.