This is probably a very trivial question for an Excel expert, so I apologize in advance. I spent hours on this, but as everything in Excel -- unless one is an expert in it they will probably find quantum physics easier.
I have a workbook with a sheet which needs to pull data from another sheet. There are two lookup criteria:
A row-based lookup on the other sheet, which is working and finding the corresponding row.
In the corresponding row on the other sheet, I need to grab a value from a cell in that row based on a dynamic column name. So I have a string-based name of the column (i.e. the header; i.e. row #1), and I need to grab the value from the it based on the column's name.
Here is my lookup code and what I am trying to do:
=XLOOKUP(
// Source data for row lookup (working)
D3&H3,
// Destination data for row lookup on other sheet (working)
'Prices'!$A$2:$A$1048576 & 'Prices'!$B$2:$B$1048576,
// Not real code, but the part that I am trying to accomplish.
// The CUSTOM_COLUMN_NAME will come from either a formula or
// another cell on the given sheet, and is supposed to denote
// the column header name on the Prices sheet.
'Prices'["CUSTOM_COLUMN_NAME"]:$2$1048576
)
(I provided the entire function just in case it would be easier for someone to rewrite it with VLOOKUP or HLOOKUP)
Hopefully this makes sense, and any help would be sincerely appreciated...
Here's an example of 2-d look-up using MATCH and INDEX, and it will work across sheets.
I am currently working on a database (that's why I needed to blur some cells.) and I want to copy some data from the first sheet according to the graduation status. We are planning to use this database for next years too, so I want it to copy the data automatically when someone adds information. I wrote a formula for this, it is copying the data as I want but it cant skip the false condition; as it can be seen, the 8-9-16-17th row in General Sheet is copied to Student Sheet.
I saw another problem like mine and tried to implement the formula in my sheet but I couldn't make it work.
The problem that another person was dealing with: Get cell value but skip row if wrong
The formula I found and tried to implement in my Excel book: =IFERROR(SMALL(IF(($B$2:$B$15="Denied"),$A$2:$A$15,""),ROW()-2),"")
The formula I used in my Excel book: =IF(GENERAL!E3 = "Student";Table1[#Name];"")
With Excel 365 you can use the Filter() function. In the sreenshot I used
=FILTER(A:C,B:B="student")
Be aware, though, that with any formula solution, the result will be dynamically recalculated, so if you are planning on adding any data to the filtered table, these manual data entries will become a problem when the formula updates and the previous results occupy different positions.
If your goal is to get a one-time copy of all the non-graduated Students in Sheet A, you could just sort the sheet by the status column and copy/paste the desired data into a new sheet. That pasted data will not change and you can make manual edits.
So basically, I have been trying to make excel scan one column and print out the row for cells which have specific letters.
For example I have the following data in my sheet.
What is required is to be have excel search for the values which contain T and I, and then print the new rows. Kind of like separate the two into two different tables, because then so that I can do further analysis on them.
So far I have been trying to use the VLOOKUP() function, but the problem with VLOOKUP() is that excel required a proper match and not just a letter in the cell. I had tried with both FALSE and TRUE. Then instead I tried to use the =INDEX($B$4:$K$9;MATCH($A$17;$A$5:$A$9;0);COLUMN(A4)) to make it work. But that also does not work, since it also requires a full match. Also another problem which I didn't realise before is that how can excel recognise each cell, because I will have different number after the letters everytime and then so how can one make excel not repeat the same row twice?
I have used another approach where I copy the data in a separated sheet and then I simply filter out the Ts and then copy/paste the Is into another sheet and vice versa. it is time consuming and so it would be much better if I can simply copy/paste my new data and it would generate the division on its own.
any suggestions or link would be really helpful.
UPDATE
I had a new idea on how to approach this problem. I was thinking that is it somehow possible to have VBA code running for filtering the data. Is there a way to specify in VBA code to filter the data by "Starts With" and Make the results be printed in another cell block?
Looks simple enough. First step is to make sure you have headers over your data and that it is in proper table format similar to my picture. Then select Data set and press CTRL+T. That should turn you data in to table object with stripes. Use the Formula =LEFT(C2,1) to take out the first letter which will be L or T.
Select the table and press ALT+D+P which will generate a pivot table based off original data set.
Drag the column with the formula I suggested over to the FILTERS area of the pivot table ID column to ROWS and all others to VALUES. Simply refresh and as new data is added you will get new pivot tables. Do not put the pivot tables on top of each other as I did that is only for the picture so you can see it. If you have too many filters to apply you can right click the helper column in the pivot table fields area to produce a slicer which is a button that helps you change the report quickly. Any other questions do ask.
I use a table for work that has about 10 rows but I want to expand it to as high as 200. I use this table to keep track of specific tickets that I need to work on that shows me the status and follow up date. I use formulas in the adjacent cells to give me follow-up dates and specific comments based on the values of the first 3 cells in the row.
This is basically what I am trying to have setup... The first column of the table has a shape/button with a macro attached to it. I use this macro to clear the contents of the next 3 cells to the right of it. I want a button for each row of the data table to use as a simple way to delete entries. I use another macro to sort the table so that there are no blank entries between others in the table.
I use this code to clear the contents and have to edit it for a new row:
Range("B4,C4,D4").Select
Selection.ClearContents
Is there an easier method to accomplish this without having to write a macro for each of the buttons for the rows next to it?
I have a spreadsheet that will occasionally get new data that I don't know the contents of, I just have to add it to the spreadsheet. Some of the new data is just updating rows that are already in the spreadsheet, and other data is adding new rows. I'm looking for a way to add a column that will tell me if something has changed in the row when I compare the old spreadsheet to the new one.
The sheets have one column that will always have a unique value among all the rows, so I can use that to match rows if the sheets aren't sorted the same way. Here are some screenshots to show what I'm trying to do:
Old Spreadsheet:
New Spreadsheet:
The only solution I can think of is a large nested IF formula that compares each column one by one, something like:
=IF(Old!B2=New!B2,IF(Old!C2=New!C2,"NO","YES"),"YES")
The problem with that is that it gets very hard to look at since my actual data is using 33 columns (not including this "Changed?" column) and new columns could be added in the future.
I'm not very technical with Excel, nor have I ever used VBA, so I apologize in advance if there is a simple/obvious solution that I'm missing.
Thanks in advance for your help.
Using your example, in the 'New' sheet cell D2 and copied down:
=IF(COUNTIF(Old!A:A,A2)=0,"YES",IF(SUMPRODUCT(COUNTIF(INDEX(Old!A:AG,MATCH(A2,Old!A:A,0),0),LEFT(A2:AG2,254)&"*"))=SUMPRODUCT(COUNTIF(A2:AG2,LEFT(A2:AG2,254)&"*")),"NO","YES"))
vlookup would also work well for this problem.
in D2, the formula would be:
=IF(AND(VLOOKUP(A2,Old!A:C,2,FALSE)=B2,VLOOKUP(A2,Old!A:C,3,FALSE)=C2),"NO","YES")
The column numbers (2 and 3) are the columns that correspond to the data you are trying to match, using the ID column.
It's possible to find the appropriate column using MATCH if the column names you have match the column names in the old sheet
This would make the formula look more complex, but Excel would adjust the Old!A:C reference if more columns are inserted.
The formula would look like this to match against column names
=IF(AND(VLOOKUP(A2,Old!A:C,MATCH($B$1,Old!$1:$1,0),FALSE)=B2,VLOOKUP(A2,Old!A:C,MATCH($C$1,Old!$1:$1,0),FALSE)=C2),"NO","YES")
The difference between this and the last one is the use of MATCH($B$1,Old!$1:$1,0) to find the column (using $s to anchor the lookup values)
In this case, specialized software for Excel compare is better.
My company use this software. Check it out.
http://www.suntrap-systems.com/ExcelDiff/
http://www.youtube.com/watch?v=QQgnWr_RT-8