Broken formula

KnAsTa

Board Regular
Joined
Apr 11, 2002
Messages
52
Ok, vlookup again:

=IF(ISNUMBER(MATCH(A5,week1.xls!$A$1:$A$10,1)),IF(VLOOKUP(A5,week1.xls!$A$1:$C$10,3,0)>VLOOKUP(A5,week1.xls!$A$1:$D$10,4,0),1,0),

This first half works. Returns 1 and 0.

IF(VLOOKUP(A5,week1.xls!$A$1:$C$10,3,0)<VLOOKUP(A5,week1.xls!$A$1:$D$10,4,0),0,1))

The second half does not work, returns #N/A.

Still really confused. The first part only worked once i had put in the second half of the equation. Without the second part it gave me 1's and 0's which made no sense.

Can someone please explain this or show me the correct code.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Sorry, scrap that question, now i need to know how to use a for loop in a formula.

=IF(ISNA(ISNUMBER(MATCH(A5,week1.xls!$A$1:$A$10,1))),IF(ISNA((VLOOKUP(A5,week1.xls!$A$1:$C$10,3,0)>VLOOKUP(A5,week1.xls!$A$1:$D$10,4,0))),1,0),IF(ISNA(VLOOKUP(A5,week1.xls!$A$1:$C$10,3,0)<VLOOKUP(A5,week1.xls!$A$1:$D$10,4,0)),0,1))

How would i get it to loop 19 times, ie, from week1.xls to week19.xls (19 external files)

Thanx
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,748
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top