Excel Lookup and pull in depending on cell contents - excel

Another tricky issue for me.
I have worksheet with all my information. On another sheet I need to pull a number depending on a specific value. for example:
On the Master sheet,
Cell AN2 will contain either BMI or ASCAP
Cell A2 will contain a number, let's say 12345
On my Second sheet, I have two columns; AJ2 for BMI# and AM2 for the ASCAP#
I need to look at the Master sheet, decide if A2 is a BMI or ASCAP number (from AN2) and put it in the correct cell on the Second sheet.
I know this is a Vlookup function, but I can't get it to work. I did a search and read through some of the answers, but still can't get it to work.
Thanks for all the great info here.
Using Excel 15 on MacOS

I think if you put this formula into your second sheet in AJ2:
=IF(Master!AN2="BMI",Master!A2,"")
And this in AN2:
=IF(Master!AN2="ASCAP",Master!A2,"")
And copy those values down, it should work. This will, of course, only populate one of the two for any given row, but based on your description it sounds like that's what you wanted.
And of course if your sheet isn't literally named "Master," change it to whatever the sheet name actually is.

Related

If a cell in column A in sheet 2 equal to a value from sheet 1 then return the values from sheet 2 to column B and c in sheet 1

I am looking to do a kind of automatic cell updates on excel, which is a status update for a product we got and the location of the product in the warehouse.
I have basic knowledge of VBA and I didn't manage to code anything to help me with that. I tried to use If function, but didn't make sense because I can't find a way to achieve what I need.
Here is sheet 1
and sheet 2
examples.
This is what I am trying to achieve:
if a cell within Sheet2 column A range = Cell A2 in sheet 1, then fill Sheet1, B2 cell and Sheet1, C2 cell with the information from sheet2 on the condition that it is the most recent entry (in the example images it is the entry with the dispatched status)
Would you recommend VBA or using formulas, and if so what should I do?
This can be done with formulas, however getting the latest value isn't as easy as it seems. This can be achieved however by following this tutorial for reference. I especially refer to the part using LOOKUP(.
Other than that, all you need to do is set your ranges to refer to the correct sheet.
=IFNA(LOOKUP(2,1/(Sheet2!A:A=Sheet1!A2),Sheet2!B:B),"")
My formula in B2 is:
=INDEX(Sheet2!$B:$B;MAX(SI(Sheet2!$A:$A=Sheet1!A2;ROW(Sheet2!$A:$A)-MIN(ROW(Sheet2!$A:$A))+1)))
My formula in C2 IS:
=INDEX(Sheet2!$C:$C;MAX(SI(Sheet2!$A:$A=Sheet1!A2;ROW(Sheet2!$A:$A)-MIN(ROW(Sheet2!$A:$A))+1)))
Both formulas are array formulas so instead of entering them with ENTER, they must be entered pressing
ENTER+CTRL+SHIFT at same time
Anyways, these formulas will probably make your file heavy and slower. Think about redesigning the way you save data, and consider adding a date field, and resuming data with Pivot Tables.

Using SUMIF function and the range and [sum_range] change with every cell

I have looked for this answer but haven't found anything that has worked so I apologize if this is a duplicate question.
I am using Excel 2010 and have two sheets within one workbook. The first sheet holds the majority of information regarding individual members and is where I am using the formula. The second sheet holds data regarding each members' usage. Each line represents one individual. I am trying to gather all of the instances for one individual listed in sheet two and place it in a cell in sheet one.
I have used the sumif function which works perfectly for the first individual I use it on. After that, dragging the box changes both the range and sum_range of the formula along with the criteria. I want the criteria to change to the cell in the next row but I need the range and the sum_range to remain the same for every cell. If I copy the formula from the first cell and paste it into the second row, nothing changes.
Any ideas as to how I can make the sumif formula work over the entire column without changing the range and sum_range? Or is there an easier way to do this? Please keep in mind, the second sheet will expand over time to include more and more instances which will need to be included in future calculations.
Lets say your range is A1:A3 so to completely lock it just change it into $A$1:$A$3.

How can I search across Excel sheets?

I want to transfer data automatically from 2 sheets to one single combining one. That means I have 2 different export sheets (called 'Te_open' and 'Te_closed') that contain both the columns "Problem" (in different positions, can vary always). I have one sheet, that represents an overview of the data from the two other export sheets. So when I have for example the value "Te1" in the cell A2 of my overview sheet, I want Excel to search in the two export sheets the value "Te1" and give back the value in the same row as "Te1" but of the column "Problem", so that I can fill the cell B2 where I want to have the Problem type. So I thought I might need the "MATCH" formula, to let excel know I want to search the column with the headline "Problem" in the export sheets, to fill the column "Problem" in my overview sheet.
The problem that I see is that I have to search TWO sheets and I don't know in which one the "Pm1" will appear. Furthermore I don't know in which column of the sheet "Problem" will appear.
Can you please help me? I would preferably like to solve the problem with a formula, not a macro. Thank you very much in advance.
Kind regards,
question
To find the index of the first column in one of your sheets that is headed 'Problem', you can use (e.g.):
=MATCH("Problem",Te_open!$1:$1,0)
Let's assume we place that formula in a cell somewhere and name the cell open_col. To find a value in column A of Te_open and return the corresponding value from the 'Problem' column, you can then use:
=VLOOKUP(A2,Te_open!$A$2:$Z$999,open_col)
Note that you'll have to define the search range to include the largest range that your data on Te_open could occupy. If the search value is found this will return the corresponding value from the 'Problem' column, otherwise it'll return #N/A. So if you've also set up a cell called closed_col to get the column index for the Te_closed sheet, you can do:
=IF(ISNA(VLOOKUP(A2,Te_open!$A$2:$Z$999,open_col)),VLOOKUP(A2,Te_closed!$A$2:$Z$999,closed_col),VLOOKUP(A2,Te_open!$A$2:$Z$999,open_col)
That gets the result from the correct column of Te_open if the search value was found there, otherwise it gets the result from the correct column of Te_closed. If neither sheet contains the search value it'll return #N/A.

Excel 2007 Using an Indirect reference over multiple rows

In Excel 2007 I use the following formula to refer to cells in other worksheets in the same workbook:
=INDIRECT($B$2&"!A9")
B2 contains the name of the worksheet containing the target cells (I want to turn this into a template, so I don't enter the name into the formula). The formula works, but I want to use this same formula over multiple rows (A10, A11, A12 [...] A1000). I am using this same code over multiple rows but with different fields (B9, C9 and so on), with a variety of different content types (data, number, text).
An alternate version of the formula is as follows:
='Worksheetname'!A9
But again, this requires hard-coding the name of the worksheet, which is not desirable for me.
Because of the sheer volume of the rows manual editing is not an option: is there any way to alter this formula so I can easily use it over multiple rows? Preferably without the use of VBA, but that is not a requirement.
If your records are located in the same cells in both worksheets, then you can use something like following:
=INDIRECT($B$2&"!"&ADDRESS(ROW();COLUMN()))
IF now, then you can easily offset them using given ADDRESS function
P.S. Please be aware with INDIRECT function that it slows down calculation performance on your workbook (few functions are OK, but if you have 10,000 of them then you might see some delay)
If you want to use the same formulas for several columns as well you could include something like this:
=INDIRECT("'"&$B$2&"'!"&ADDRESS(MATCH($B4;INDIRECT(CONCATENATE ($B$2;"!";"B:B"));0);MATCH(B$3;INDIRECT(CONCATENATE($D$2;"!";"A3:AR3"));0)))
B2=reference to sheet name
B4=first row for your data
B3=Column header
For those who want to pull all the same column of data from multiple sheet that have the same layout (and have each cell linked), it took me hours to work it out, but actually can be solved with a relatively simple way:
=OFFSET(INDIRECT("'"&G$2&"'!l7"),$A6,0,1,1)
The Indirect part take you to the right sheet and right cell, G2, H2 ... has the Sheet names (be mindful of sheet name with space, you will need to use ' ', which is the case for my workbook), and L7 cell of that sheet, and I want L8, L9, ----L200 all being pulled through;
Offset help you navigate the range of rows, A6 is an additional numbering row I added to move to the right row in each sheet.
Hope it help!

how to pull data from a sheet named as per value in the cell on a different sheet

I have a multiple sheets in a workbook for orders on a same format and it will keep adding. Sheet name will be order number.
I wants to create a Quotation sheet with a different format but same information from any order i want to print the quotation agaisnt.
i am looking for a code or formula help to pick the information from Order sheet as per number / name on the quotation sheet. i.e. every time i change the number in a specific cell it pulls information from respective order sheet only.
will greately appreciate your help
Thanks
Naman
I have assumed your sheet names are in A2:A4 (just 1, 2 and 3) of some 'other' sheet and the reference of the cell you wish to refer to is always D6 (the value in B1 in 'other`, which can be changed):
The formula is B2 of 'other' (copied down) is:
=INDIRECT(A2&"!"&B$1)
My comment to this question describes one way to make such links dynamic.

Resources