# IF fx for comparing sheets. Need help

Hi, This is what I'm trying to figure out. I have Sheet1 that has an income statement colA name of accounts and I want numbers to go in ColD (this is where my formula will be) from Sheet2 .

Sheet2 colA has account names and ColB has a numbers. I want to compare the text between sheets 1 & 2 for colA , then if true then return the number from Sheet2 ColB.

This is the formula i tried bur got a =IF((A8:A70)=sheet2(A8:A70),sheet2(B3:B70),"--") . I get a 508 error code

Thanks Ann

edit retag close merge delete

Sort by » oldest newest most voted

Dear Ann! It seems to me that you are looking for the VLOOKUP() function

Try this

=IFERROR(VLOOKUP(A8;Sheet2!$A$8:$B$70;2;0);"")


Paste this formula to cell D8 and fill it down

more

Hi, nope doesn't work. The A8 text is in Sheet2 but it is not returning the number I need. The columns in each sheet have different positions in which there's a label. e.g. In A8 in sheet 1 is labeled "loans" in sheet 2 A8 is labeled "Other Income". The return result is just a blank cell.

( 2017-09-22 22:57:14 +0100 )edit

Wait I just figured it out . There was supposed to be a "." after Sheet not an "!". Great. it's fixed. Thak you so much you saved me hours of time. Ann

( 2017-09-22 23:02:41 +0100 )edit

Hum Am i supposed to put something between the quotes? And what does the 2 mean? Anyway it does not work as is but thanks alot Ann

more

2 mean "take the data from the second column" (in range A8:B70 column A is 1st, B - 2nd). You say that it does not work? Are you sure that the values in columns A on both sheets are the same? You can use short formula =VLOOKUP(A8;Sheet2!$A$8:$B$70;2;0) without quotes and IFERROR. But if no value is found, you'll see #N/A