Excel Formula for importing data from several sheets - excel

I have a massive excel document with multiple sheets I need help importing data with from one sheet to another.
In sheet 1 there is a list of entities and what the affiliation's of those entities are. On sheet 2 there is the same list of entities and column name describing each affliction. My goal is to have a formula which looks at each affiliation's and marks a Yes where the Colum name representing the affliction is.
An example of what I mean is:
There is one sheet (sheet 1) which has a column named "Student", and another column next to it named "Favorite color" there are about 4000 (rows) student's information. Some students might have more then one favorite color, but in that case there are 2 entries of the student in the sheet. On another sheet(sheet 2) there is the same column "Student" but there are several columns with each color of the rainbow (Red, Blue, Green etc) these columns have to be marked with a yes or a no. I need to read back into sheet 1 and mark a yes on the 2nd sheet depending on the color described on sheet one.

A VLOOKUP will not suffice when the student can have two "favourite colours". Instead, assuming the same sheet format as #Nelly27281, you can use a COUNTIFS in the following way:
=IF(COUNTIFS(Sheet1!$A:$A,$A2,Sheet1!$B:$B,B$1)>0,"YES","NO")
This counts the number of instances in Sheet1 where Column A contains the student and Column B contains the colour. If it's greater than 0, we associate the student with the colour.
EDIT: sorry, I've assumed here that Column A of Sheet2 contains a list of the students without any duplicates.

Here is the formula that you can use. Place the formula in cell B2 and drag it across the columns and rows that you want to cover:
=IF(VLOOKUP($A2,Sheet1!$A:$B,2,FALSE)=B$1,"YES","")
Assuming your data are presented like:

Related

Excel Function for looking at text in a cell

My goal is to enter in column E on sheet 2 whether or not the customer used the discount code "BUNDLE3".
I would like to look at the order number in sheet 2 represented by column A then look at Column A in sheet 1 (where my orders data is) and if they match, then look at column M(discount code column in sheet 1) and if Column M has the text "BUNDLE3" then return Yes, if not return No.
The formula I was using is the one below, where orders_export_1 is sheet 1. It doesn't work because its not looking at the order numbers at all.
=IF(ISNUMBER(SEARCH("BUNDLE3",orders_export_1!M2)), "Yes", "No")
Please refer to image links for more clarity.
sheet 2, where I am trying to use an excel function in order to find out if an order (represented by column A) used the discount code "BUNDLE3"
sheet 1, This is my orders data. Sometimes orders take up multiple rows since they are listing the products customers have purchased.
In Sheet2, E2, put this formula and drag down:
=IF(COUNTIFS(orders_export_1!$A$2:$A$100,A2,orders_export_1!$M$2:$M$100,"BUNDLE3"),"Yes","No")
Adjust the range on orders_export_1 as needed.

Using excel to count complete/incomplete across several sheets

I am trying to do the following.
I have 10 sheets labeled Teacher1 through Teacher 10 and an 11th sheet named StudentRoster.
In the StudentRoster sheet I have a list of 100 students names. StudentA, StudentB, StudentC, etc..
In each of the sheets Teacher1, Teacher2, Teacher3, etc. I have about 20 cells in column A that use some of the names listed within StudentRoster (these would be class rosters)
In each of the Teacher1, Teacher2, etc sheets column A will have the student names and column B will be a column in which I will manually insert an "X" to indicate completion of an assignment. Within the StudentRoster sheet I would like to have excel search through Teacher1, Teacher2, Teacher3, ... Teacher10 and count how many "X"s exist for StudentA. Student A may or many not be in all Teacher sheets
Can someone provide me with a way of doing this, I have been trying to use the COUNTIFS formula but I am struggling having it look for StudentA and then to begin counting only the "X"s for StudentA.
List your worksheets on the 11th sheet and name the range sheets then you can use this formula:
=SUMPRODUCT(COUNTIFS(INDIRECT("'"&Sheets&"'!A:A"),A1,INDIRECT("'"&Sheets&"'!B:B"),"X"))
Easiest would be to add a column to each teacher sheet to the left of the studentname. In that column you put in =COUNTIF(range;"X"). Fill in relevant range e.g. C1:K1.
In the student roster list you could use add a top row with the teacher names and sum. With sumif(range of student names in Teacher 1 sheet; select cell with student name in roster; range in teacher 1 sheet with countif outcomes)
Then sum over all sumif statements by student for the total.
There would be other methods, but this one is least complicated and straightforward I think.

How can I compare two columns then return the value from third or fourth?

To make things easier I will explain what my document contains: I have 3 sheets in excel. The first and second contain Product Numbers and product Labels. The third sheet combines both sheets' product numbers, I want to compare both sheets product numbers and find the corresponding product label.
Which function would I use to do this? I would want the formula to search column 2 for any matching product numbers from column 1 and fetch the product label which matches. If not, I would want it to search column 3 and fetch the right product label from that sheet.
Sheet called "FORM" which needs labels from other 2 which match part number
Sheet called "B2B"
Sheet called "B2C"
[
In E2 of Form sheet paste
=IFERROR(IFERROR(VLOOKUP(A2,B2B!A:E,5,FALSE),VLOOKUP(A2,B2C!A:E,5,FALSE)),"Not found")
Then drag this formula down for however many rows you are trying to retrieve partnames for.

Excel: Comparing a column and if the name is identical give it a red color. But if the name in another column is different leave it the normal value

I'm quite new in Excel and I am trying to edit a code already in use.
My question is based on two columns: A and B (Worksheet is a symbollist)
Column A= PLC
Column B= Name.
If Column B has any cells that have the same name those rows will turn red using the following existing code(conditional formatting):
=AND($B2<>"";COUNTIF(tblSymbolList_Name;$B2)>1)
So if cell B2=name and cell B3=name than these rows will fill up with red color. Now I want to add a twist to it like this:
A2=plc1 B2=name
A3=plc2 B3=name
If this happens the rows must return to their original value(because the values in column A are different so it doesn't matter that B is the same), but somehow I can't get this done. Can any of you help me?
Regards,
Patrick
Try this formula with the conditional formatting:
=AND($B2<>"";COUNTIFS(tblSymbolList_Name;$B2;A:A;A2)>1)
I don't know all your named ranges, so replace A:A by the corresponding named range if applicable.
COUNTIFS allows you to count based on multiple criteria.

Refference parts of a row based on cell valus, and also add information.

I will to try to explain this as best as I can.
I have 2 sheets:
- Sheet 1
- Sheet 2
Sheet 1 has a lot of rows with information, name, address.. ads etc.
The important one is "Ads". You can Select, Yes, No or Maybe via dropdown.
If the user selects YES on sheet 1, on the "Ads" column the the information in the SELECTED columns will be referenced to sheet 2 assuming you have "Yes" in the "ads" column.
I can use the IF statement, if ROW 2,3,4, state yes and row 5,6 states NO and row 7 states yes.
Then on sheet 2, there will be 2 rows that are not populated, so I would like to get rid of the 2 rows to make things look nicer.
I would also like to states that on Sheet 2, there will be extra information for the ads, such as time, date, locate etc etc.
I am not sure if there has to be a macro.
I hope this is clear , please as anything which you make need to know
Thank you
Updated:
In sheet 2 Column b,c,d etc... I will put NEW information about connected to column A in sheet two. How if I change a old Yes to No in sheet 1 regarding ads. the rows adjust in Sheet 2, but one column A, no b nor c etc. So you looses the preservation of the data. Any solution around that. – Arthor 2 days ago
One way with no array formulas, just uses a "helper column" off to the right on sheet1, the same sheet you're selecting ADS = yes/no on.
Let's assume column Z is empty.
Let's assume the "ADS" column is column M.
In Z2, put this formula: =IF(M2="Yes", N(Z1)+1, N(Z1))
Copy that cell down column Z to the bottom of the data set. The result is an "index" where you can spot the "YES" rows based on when the index number increase by one. Now let's use the index.
On Sheet2, put this formula in A2: =IF(ROW(A1)>MAX(Sheet1!$Z:$Z), "", INDEX(Sheet1!A:A, MATCH(ROW(A1), Sheet1!$Z:$Z, 0))
The first column A value from sheet1 where "yes" is in the ADS column. Now copy that cell to the right to get the rest of the values from that row to appear.
Now copy that set of cells down and across the sheet2 table to get your values to appear. You can copy down a ways and the values will go blank when it runs out of "yes" rows.
This will not only display all the yes rows, it will display them in the same order they are on sheet1.

Resources