Need to match data in different sheets and replace data in another cell if it's a match - excel

I need to match data in column A2 and so on in sheet 1 to data in column A2 and so on in sheet 2. If the data in column A of sheet 1 and sheet 2 match I need the data in column B & C of sheet 2 to replace data in column B & C of sheet 1. I know VERY little about doing this kind of stuff so any help would be GREATLY appreciated!
SHEET 1
A B C
2 12345 5.35 9.95
3 15874 4.22 10.99
4 11111 2.24 5.99
5 98745 5.33 9.95
6 88552 4.24 8.95
SHEET 2
A B C
2 11111 2.09 5.79
3 12345 5.11 9.89
4 88552 4.01 8.79
NEED SHEET 1 to change to
A B C
2 12345 5.11 9.89
3 15874 4.22 10.99
4 11111 2.09 5.79
5 98745 5.33 9.95
6 88552 4.01 8.79

On a third sheet use these functions
column a ='sheet1'!a2
column b =if('sheet1'!b2='sheet2'!b2,'sheet2'!b2,'sheet1'!b2)
column c =if('sheet1'!c2='sheet2'!c2,'sheet2'!c2,'sheet1'!c2)
Copy sheet3 and paste the values into sheet1.
This should work unless column a does match. or if you need to do this dynamically. If column a doesn't match some vlookups can be thrown in.
I your data does match in column a your formulas could look something like this.
column a ='sheet1'!a2
column b =if(not(iserror(vlookup(a2,'sheet2'!a:c,2,false))),vlookup(a2,'sheet2'!a:c,2,false),vlookup(a2,'sheet1'!a:c,2,false))
column c =if(not(iserror(vlookup(a2,'sheet2'!a:c,3,false))),vlookup(a2,'sheet2'!a:c,3,false),vlookup(a2,'sheet1'!a:c,3,false))

this is too much to put in a comment so I'm putting it in answer.
The way I under stand is, since sheet1 has more data, you only want to be doing this comparison when sheet1 and 2 both have data on the row. so If sheet1 has data in rows 1 - 100, and sheet2 has data in rows 1 to 50, you only want to be doing this comparison for the first 50 rows in sheet1 right?
So, rather than copying and pasting formulas, what you can do is, in sheet1, find an unused column. go to the first row. in the formula box, type: "=if(" without the quotes. now, select the first cell to compare, according to your example you'd select sheet1, A2. then type "=" without quotes. then select the second cell you want to compare - in your example, sheet2, A2. then type "," without quotes. then select the cell from which you want the data if the first 2 cells are equal. in your example, sheet2 B2. then type "," without quotes, then select the cell with the data to use if the first 2 cells are not equal. in your example, sheet1 b2. then type ")" without the quotes.
so using your example, the function would look similar to how bigtree had it: =if('sheet1'!A2='sheet2'!A2,'sheet2'!b2,'sheet1'!b2)
so, this will compare sheet1 cell A2 with sheet2 A2 and if they are equal, the cell you put the formula in will the have the value of sheet2 b2, and if they are not equal, the cell with this formula will have the value of sheet1 B2. then, drag this formula down for however many rows you want, and the formula will adjust automatically for each row. you'll see the numbers increase. then, select the column with the formulas, right click and select copy, then right click and go to paste special, and click values. this will make it so the column contains only the values, not the formulas, now you can paste this data in column B sheet 1.
you can reuse this formula for whatever columns, just follow the steps.
HTH, good luck!

Related

Input data into a 2nd cell, based on the value of a 3rd cell? (Like "conditional formatting")

B1 is a checkbox. If checked B1=1. A1 can range from 0 to 10. If B1 is checked I want A1 to automatically = 10. Exactly like conditional formatting would turn it green. I cant put the formula =IF(B1=1,10,"") into A1 though because I need to be able to input other values in A1 without erasing the formula. I need to be able to reuse the sheet multiple times.
Ex.
A B
1 10 x
2 9
3 10 x
4 4
As Scott commented, you'd need to use VBA to do exactly what you're asking. A work-around, though, would be to add a third column with:
=IF(B1="x",10,A1)
In this case, Column A would be the user-inputted number, Column B would be your "x", and Column C would give the final output: 10 if B has "x", and the number from A otherwise.

Fill empty cells with values from a list in another column

I have the following Excel spreasheet:
A B C
1 =IF(B1<>"",B1;OFFSET(B1,-1,0)) CompanyA
2 =IF(B2<>"",B2;OFFSET(B2,-1,0))
3
4 CompanyB
5 CompanyC
6
7 CompanyD
In column B I have a list of different companies and it might happen that they are empty rows (in this case row2, row3 or row6) between the companies.
In column A I want to achieve that the empty rows are filled with the company names so in the end the spreadsheet looks like this:
A B C
1 Company A CompanyA
2 Company A
3 Company A
4 Company B CompanyB
5 Company C CompanyC
6 Company C
7 Company D CompanyD
I tried to use the If-formula with the offset in column A but it only works when there is not more than one empty row so it only works for CompanyB,C and D but not for company A.
Do you have any idea which formula I have to use in column A to solve this issue?
Pls refer the snap below
In A2 apply the below formula and drag down
=IF(B2<>"",B2,A1)
EDIT #1: Another method if data starts with row 1
if the data starts with B1 then apply the below formula in A1 and drag down
=IF(B1<>"",B1,IF(ROW()=1,B1,OFFSET(A1,-1,0)))
Provided the first cell, say B2, is not empty try with:=B2 in cell A2 and =IF(B3<>"";B3;A2)in cell A3 and fill down.

What formula do I use to get the answer from sheet 2, column B into sheet 1, column R, by having the part number be the only link to both sheets?

enter image description hereWhat formula do I use to get the answer from sheet 2, column B into sheet 1, column R, by having the part number be the only link to both sheets?
I need to get the pre-set cost value in sheet 2 into an ever-changing sheet 1 spreadsheet. The cost stays the same-sheet 2 is my legend, but different numbers are in-putted into sheet 1 all the time, and I want the cost to automatically populate from sheet 2 into sheet 1. Each number needs a cost.
Example:
Sheet 1:
Column A Column R
3568 (need formula to = 7.30)
1660 (need formula to = 1.50)
Sheet 2: Numerical-Once and a while new numbers will be added
Column A Column B
0270 2.20
1660 1.50
2610 8.00
3568 7.30
Where 0270 = 2.20, 1660 = 1.50, and so on...
Thanks in advance!
Try this formula in column R, starting in row 2
=vlookup(A2,Sheet2!$A$1:$C$1000,2,False)
If you omit the last parameter, it defaults to TRUE, which requires the data to be sorted and will return an approximate match if no exact match is found.
Also, if you copy the formula down, make sure that the lookup range has absolute references for columns AND rows, i.e. Sheet2!$A$1:$C$1000 and NOT Sheet2!$A1:$C1000

Match name and copy row from sheet 1 to sheet 2 on corresponding column

I asked a very similar question to this one here, but I am trying to identify if a cell's numerical value is contained in a list of cells on a different sheet. If the cell from sheet A matches a cell in sheet B, mark a different column in B with a corresponding row in sheet A, otherwise leave it blank. An example is below:
Sheet A
Column A | Column B
-------------------
1 John
2 Sue
4 Bob
I would like the corresponding Sheet B to populate Column B like this:
Sheet B
Column A | Column B
-------------------
2 Sue
3
4 Bob
=IF(ISNUMBER(MATCH(I2, 'SALT, WOD, Champion Members'!A:A, 0)), "Y", "N")
I have been using the above answer to populate a different column in the same workbook, and I'm thinking I can maybe use this formula, but instead of "Y" or "N", somehow preserve the row.
You need to use VLOOKUP as already mentioned. But you will need to use another function to check for existence of the value, else you will get #N/A against ID 3
I used COUNTIF
=IF(COUNTIF($A$2:$A$4,E2)=0,"",VLOOKUP(E2,$A$2:$B$4,2,FALSE))
Use the VLOOKUP function:
=VLOOKUP(A1;Sheet1!A:B;2;FALSE)
Where A1 is the value you want to look up, Sheet1!A:B is the original sheet with the data.

Microsoft Excel 2010: Help making a Formula to up Values by a repeating pattern

I have a Spreadsheet, and inside this sheet contains a column with numbers, I want to make a formula that will go down that Column and do basically this.. Values: 1 will be 9.50. 2 will be 9.75. 3 will be 10.00. Ect going up to Value of 100? Is that possible for a Formula? I keep playing with it but can't really seem to get it down. Any help would be appreciated.
Column A: 1
1
1
1
1
2
2
2
2
2
2
2
2
2
3
3
3
3
There is not a set amount to how many values are in there.
this should do it supposing that column A has these values 1, 2 ...etc that your computing will be based on
=MIN(9.25+A1*0.25;100)*COUNT(A1)
In A2, enter the formula
=A1 + (9.5-A1)
then in the cell just below it (A3), enter
=A2+0.25
Assuming A1 is the top left. Copy the formula in A3, select the next 399 cells and paste. Then select A2 - A364 and copy. Then select B2 -xx364 and paste. xx is the last column with data. If you want, set the height of your first column to 0 to hide it.
=(A1-1)*0.25+9.5 where A1 contains any number you want

Resources