Excel: Extract data from well beneath unique identifier - excel

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.

Related

How do I reference the three largest values in a column and their corresponding text in the column next to it?

I am building an excel sheet that returns the three highest values from a column in another sheet (sheet2, column B) along with their corresponding company (sheet2, column a). Ultimately, in sheet 1, I want to have a table that will display the company with those values.
This is what I am trying to achieve:
AWS ($280.9m), Google ($241.9m), Meta ($168.7m)
I was trying to use the large formula, but this does not help me with referencing the corresponding company so I’m unsure how to return both.
You can use LARGE to get your top-n, and then wrap with INDEX/MATCH and OFFSET to get the company name.
Cell E3 formula:
=LARGE($B$2:$B$7,ROW(E1))
Cell D3 formula, which returns the column to the left of the Large value:
=OFFSET(INDEX($B$2:$B$7,MATCH(LARGE($B$2:$B$7,ROW(D1)),$B$2:$B$7,0)),,-1)
or remove offset and use....
=INDEX($A$2:$A$7,MATCH(LARGE($B$2:$B$7,ROW(D1)),$B$2:$B$7,0))
Drag down your formulas as far as you would like.
The above solution is good but kinda oldschool. I would use =SORT() function instead:
=INDEX(SORT(A46:B56;2;-1);{1;2;3})
Translation to human language:
=INDEX(SORT(MyArray;ColumnToSortBy;Descending);{get first three rows}, [column])
*note: depending on your windows settings your Array row separator may differ. The easiest way to check your it is to select any range with more than one row, then get to formula bar and click F9 to see result preview.
where [column] is an optional argument, by default it takes 1st column.

Can I loop on each cell of a row without VBA in Excel?

I have an Excel sheet in the following format :
I want to have a second tab that uses this data and generates a table in this format
I was wondering if this can be done without VBA ? if not, any idea how should I best approach it ?
Thanks
Suppose you have the following named ranges:
Type_A being all data in column Type_A;
Type_B being all data in column Type_B;
Type_C being all data in column Type_C;
Cat_1 being all data in column Category_1;
Cat_2 being all data in column Category_2;
Functions being all data in column Functions.
In cell B8, enter the following array formula (which needs to be confirmed by pressing Ctrl+Shift+Enter on your keyboard upon finishing the formula in the formula bar):
=TEXTJOIN(CHAR(10),1,IF((INDIRECT(B$7)="X")*(INDIRECT($A8)="X"),Functions,""))
Then highlight the output table and click Wrap Text button under Home tab to display the outcome with line break within the cell.
TEXTJOIN function is only available in Excel 365 and later versions.
A tip here, you can highlight your source table (including headers) and press Ctrl+Shift+F3 on your key board to quickly set the column header (top row) as the name for each range. Then you just need to set up the first row and first column with all types and categories for your output table, and use the above formula to return the desired output.
Let me know if you have any questions. Cheers :)

How to program excel with vlookup function

I have this excel file with two sheets. Sheet 1 is the page where all of the part numbers and descriptions are placed. Sheet 2 is a database set into two columns one with part numbers the other with the description.
I have been looking into vlookup within excel and in which case i have it working with the part numbers so when i enter the part number or choose from drop down it will auto populate the description for me. The issue I am having now is that when i enter the part number it doesn't auto populate the description column until i double click the cell with the formula and hit enter.
I also want to do a reverse lookup from the description side where it will auto populate the part number as well.
Here is my formula I used for the vslookup.
=VLOOKUP(A9,Database!$A$1:$B$250,2,FALSE)
I came up with this formula after researching how to do it but I had to change the A9 portion to each row number ie. row 9, row 10, etc..
If you want to do a reverse lookup then vlookup will not work as it only works left to right - unless you repeat the data in column A in column C...
However, the more elegant solution is with index() and match().
=INDEX(Database!$A$1:$A$250,MATCH(B9,Database!$B$1:$B$250,0))
Not tested, written based on the info you gave in your vlookup, match will find the position of the item looked for and then index collects the result at that position in column A.
The beauty of index/match is that the columns don't have to be next to each other AS LONG AS THEY ARE THE SAME LENGTH...
Try right clicking the numbers column > format cells > format as text (by choosing "text" under the categories box). Hopefully this will make the auto populate work.

Select all data in Excel by column name, omitting empty cells

The goal is to create a series of graphs that will update automatically based on the raw data.
So, I have created a graph manually and want to edit the formula to accomplish the auto update.
The column names will always be the same, so I want to be able to select all data in a column based on the name BUT ignore any cell that is blank (above zero maybe).
The formula excel has given me so far is
=SERIES(rawdata!$M$1:$M$6,rawdata!$A$2:$A$37,rawdata!$M$2:$M$37,1)
So, something like
=SERIES(rawdata![column name],rawdata![column name],rawdata![column name],1)
I'm not sure how the skipping blank columns should work either. To expand on this further only one of the columns can potentially contain blank values. So if a cell is blank in that column then that entire row shouldn't be plotted, if that makes sense!
strong text =OFFSET(Sheet1!$B$2,0,0,COUNTA(Sheet1!$B:$B) - 1)
Try this formula when you define the name for the column of values you would like to have data automatically added from. I know it works when each cell has either a formula or a value. Like a column that is automatically calculated based on values in other columns.
In this formula example the cell B2 refers to the first point of data in the column. (make sure your references are absolute! ie, use $B$2)
This automatically returns the range of data as it changes when CountA is added:
=OFFSET(reference, rows, cols, [height], [width])
=COUNTA(value1, [value2], ...)
Hope this helps! It worked for me! :) If you have completely blank cells in the column you might have to make a couple changes though.
-Reverus

Excel: Agregate multiple tables separated by title

I have an excel file generated by SAP. I need change its format from multiple tables separated by a title to one single table. This is the original table:
and i need it to look like this:
Im new to excel, so i dont have a clue how to do it.
I cant do it manually becuase the file has 5000+ rows.
Any guidance?
I usually use the generic formula:
=IF(XX="",YY,XX/ZZ)
Where XX is a cell you can use to identify a header to append to the individual transactions and YY is the cell directly above the cell you have put your formula. XX is when you need that value itself, ZZ is another value. You'll understand when you apply it.
For instance, here, you could use cell D5 to do this. I would insert two columns before column D (the value of cell D5 is now in cell F5), and put this formula in cell C5:
=IF(F5="",C4,B5)
I will then fill the formula down. This carries the Material ID everywhere down to the last row. There are two quick ways to do this in a file of this type:
Copy the formula, scroll to the bottom of the sheet, hold Shift and click the last cell in the column, then paste.
Select the cell containing the formula, scroll to the bottom of the sheet, hold Shift and do Ctrl + ,D.
In cell D5, I would put the formula:
=IF(F5="",D4,F5)
And fill it down as well to get the material description.
Now for the size per unit, you can create a column to the right of column K (column K now has 'Size per Unit' since we inserted two columns earlier), and put this formula in cell L6:
=IF(K6="",L5,K6)
Fill it down to get it everywhere.
Now, to finish it up, select the whole sheet and copy/paste values (Paste Special > Paste Values) to remove the formulae. Delete rows 1 and 2, put a filter and sort by a field such as the column 'Metric'. Go to the bottom and delete the no longer needed rows.
As a bonus, if you need to make absolutely sure that the order of the transactions is the same as initially, insert a column somewhere, put sequential numbers into it; that is the first cell in the column has 1, the second 2, then 3 etc and fill to the bottom. Be sure that it is in the filter when you delete the unneeded rows, and sort by this column when you are done.
5000+ rows is still good though, I've had to deal with 10+ workbooks each with ~90000 rows once ;)

Resources