excelproblem.xlsx
Hi all,
I am having trouble with my workbook (attached).
I have set out my problem in the workbook.
For some reason I can only lookup with a match and index reference with the first 4 dates of my data validation.
Every later date from 11/11/06 is showing up #N/A errors.
I hope I have explained enough in the example workbook.
I cannot put my finger on the problem. Help would be much appreciated.
Cheers Ollie
Last edited by Freddobonanza; 12-15-2011 at 08:31 AM.
Try changing the formula in Column 8 to return a 0 instead of a blank if error occurs...
also, if you are using Excel2007 or later, you can shorten it to:=IF(ISERROR(IF($E$8>0,$E$8,IF(INDEX(Readings!$E$12:$GT$500,MATCH($E$4,Readings!$B$12:$B$500,0),MATCH(Grazing[[#This Row],[Column2]],Readings!$E$11:$GT$11,0))<=0,$E$7,(INDEX(Readings!$E$12:$GT$500,MATCH($E$4,Readings!$B$12:$B$15,0),MATCH(Grazing[[#This Row],[Column2]],Readings!$E$11:$GT$11,0)))))),0,IF($E$8>0,$E$8,IF(INDEX(Readings!$E$12:$GT$15,MATCH($E$4,Readings!$B$12:$B$15,0),MATCH(Grazing[[#This Row],[Column2]],Readings!$E$11:$GT$11,0))<=0,$E$7,(INDEX(Readings!$E$12:$GT$15,MATCH($E$4,Readings!$B$12:$B$500,0),MATCH(Grazing[[#This Row],[Column2]],Readings!$E$11:$GT$11,0))))))
You can also fix the formula in Column 5 to give blank with Column 7 is blank instead of error:=IFERROR(IF($E$8>0,$E$8,IF(INDEX(Readings!$E$12:$GT$500,MATCH($E$4,Readings!$B$12:$B$500,0),MATCH(Grazing[[#This Row],[Column2]],Readings!$E$11:$GT$11,0))<=0,$E$7,(INDEX(Readings!$E$12:$GT$500,MATCH($E$4,Readings!$B$12:$B$15,0),MATCH(Grazing[[#This Row],[Column2]],Readings!$E$11:$GT$11,0))))),0)
=IF(Grazing[[#This Row],[Column7]]="","",IF($I$14>Grazing[[#This Row],[Column11]],$E$13+(Grazing[[#This Row],[Column7]]*Grazing[[#This Row],[Column8]]),IF(Grazing[[#This Row],[Column11]]=$I$14,$E$13,IF((INDEX(Readings!$E$12:$GT$500,MATCH(Grazings!$E$4,Readings!$B$12:$B$500,0),MATCH(Grazing[[#This Row],[Column1]],Readings!$E$11:$GT$11,0)))+(($I$14-$E$4)*Grazing[[#This Row],[Column8]])<500,0,(INDEX(Readings!$E$12:$GT$500,MATCH(Grazings!$E$4,Readings!$B$12:$B$500,0),MATCH(Grazing[[#This Row],[Column1]],Readings!$E$11:$GT$11,0)))+(($I$14-$E$4)*Grazing[[#This Row],[Column8]])))))
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
Thank you NBVC your middle piece of coding has cleaned a bit up.
..but..
There still seems to be an issue where, when the date is set to 5/12/06 or higher, the respective cells in column8 do not pick up the individual figures from the "Readings" sheet that are matched and indexed with the date in E4 in the "Grazings" sheet and the respective cells in column 2.
Cells with a reading in column 8 on higher date selections seem to pickup the average reading when they have there own individual readings that should be in that place??
I hope this makes sense..
added fresh sheet with NBVC code:
excelproblem.xlsx
Last edited by Freddobonanza; 12-13-2011 at 05:03 PM. Reason: added.. updated attachment
Do you mean date 12/5/2006 because your Readings sheet doesn't have a 5/12/06.... and with 12/5/2006 I get results.
And you can change formula in I17 also for Excel 2007 to:
=IFERROR(IF($E$8>0,$E$8,IF(INDEX(Readings!$E$12:$GT$500,MATCH($E$4,Readings!$B$12:$B$500,0),MATCH(Grazing[[#This Row],[Column2]],Readings!$E$11:$GT$11,0))<=0,$E$7,(INDEX(Readings!$E$12:$GT$500,MATCH($E$4,Readings!$B$12:$B$15,0),MATCH(Grazing[[#This Row],[Column2]],Readings!$E$11:$GT$11,0))))),"")
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
Hmmm interesting, yes I am.
I'm using a mac with Excel 2011 and an Australian date system so 5/12/06 would be the 5th day of the 12th month 2006.
I have tripled checked this..
I have also used the above formula, but with a 0 not ""
It is a puzzle that everything works fine for the earliest 4 dates and not the latter..
Any ideas would be appreciated
Attached is what I get when I enter December 5th, 2006
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
All good now,
I'm not sure what was happening.. but.. I just placed your code inside another IF equation simply saying if it didn't work to look up only part of the code.. rather blasé explanation but it works for all the later dates..
Thank you for your time.
Solving this thread and adding to your rep![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks