Hi all, I'm using two Index Match formulas in adjacent cells. They are slightly different as I want them to return a value from different ranges, but they are written in exactly the same manner, yet one works and one doesn't.
This works:
<style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'; color: #000000}span.s1 {color: #006107}span.s2 {color: #0057d6}span.s3 {color: #ab30d6}span.s4 {color: #a54a29}span.s5 {color: #33af4a}span.s6 {color: #ff9c1b}span.s7 {color: #fe4fdd}</style>{=(IF($E86=$N$82,INDEX($N$131:$N$454,MATCH(1,($C86=$C$131:$C$454)*($D86=$D$131:$D$454),0)),0)}
This doesn't (it returns 0, as per the "value_if_false" number at the end):
<style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'; color: #000000}span.s1 {color: #0057d6}span.s2 {color: #006107}span.s3 {color: #ab30d6}span.s4 {color: #a54a29}span.s5 {color: #33af4a}span.s6 {color: #ff9c1b}span.s7 {color: #fe4fdd}</style>
{=IF($E$131:$E$454=$P$82,INDEX($P$83:$P$120,MATCH(1,($C86=$C$131:$C$454)*($D86=$D$131:$D$454),0)),0)}
There are three differences that I can see:
1) The IF function in example two looks in a range, as opposed to the exact cell of example one.
2) The IF function references cell N82, as opposed to P82.
2) The INDEX range is different.
These are all on purpose. The range P83-P120 does contain some #DIV/0! cells, so I enclosed example two with an IFERROR function to see if that would help, but it returned the same value 0, so it had no effect.
{=IFERROR(IF($E$131:$E$454=$P$82,INDEX($P$83:$P$120,MATCH(1,($C86=$C$131:$C$454)*($D86=$D$131:$D$454),0)),0),0)
The only other thing I can think of is that INDEX MATCH might not like the differing ranges in example two. (ie. 83:120 not being the same size as the others 131:454). So I experimented changing the range, but it had no effect, still returning the same sorry 0.
<style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'; color: #000000}span.s1 {color: #006107}span.s2 {color: #0057d6}span.s3 {color: #ab30d6}span.s4 {color: #a54a29}span.s5 {color: #33af4a}span.s6 {color: #ff9c1b}span.s7 {color: #fe4fdd}</style>
=IFERROR(IF($E$131:$E$454=$P$82,INDEX($P$131:$P$454,MATCH(1,($C86=$C$131:$C$454)*($D86=$D$131:$D$454),0)),0),0)
So I'm at a loss as to why the first one works but the second doesn't. Any ideas are much appreciated.
This works:
<style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'; color: #000000}span.s1 {color: #006107}span.s2 {color: #0057d6}span.s3 {color: #ab30d6}span.s4 {color: #a54a29}span.s5 {color: #33af4a}span.s6 {color: #ff9c1b}span.s7 {color: #fe4fdd}</style>{=(IF($E86=$N$82,INDEX($N$131:$N$454,MATCH(1,($C86=$C$131:$C$454)*($D86=$D$131:$D$454),0)),0)}
This doesn't (it returns 0, as per the "value_if_false" number at the end):
<style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'; color: #000000}span.s1 {color: #0057d6}span.s2 {color: #006107}span.s3 {color: #ab30d6}span.s4 {color: #a54a29}span.s5 {color: #33af4a}span.s6 {color: #ff9c1b}span.s7 {color: #fe4fdd}</style>
{=IF($E$131:$E$454=$P$82,INDEX($P$83:$P$120,MATCH(1,($C86=$C$131:$C$454)*($D86=$D$131:$D$454),0)),0)}
There are three differences that I can see:
1) The IF function in example two looks in a range, as opposed to the exact cell of example one.
2) The IF function references cell N82, as opposed to P82.
2) The INDEX range is different.
These are all on purpose. The range P83-P120 does contain some #DIV/0! cells, so I enclosed example two with an IFERROR function to see if that would help, but it returned the same value 0, so it had no effect.
{=IFERROR(IF($E$131:$E$454=$P$82,INDEX($P$83:$P$120,MATCH(1,($C86=$C$131:$C$454)*($D86=$D$131:$D$454),0)),0),0)
The only other thing I can think of is that INDEX MATCH might not like the differing ranges in example two. (ie. 83:120 not being the same size as the others 131:454). So I experimented changing the range, but it had no effect, still returning the same sorry 0.
<style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px 'Lucida Grande'; color: #000000}span.s1 {color: #006107}span.s2 {color: #0057d6}span.s3 {color: #ab30d6}span.s4 {color: #a54a29}span.s5 {color: #33af4a}span.s6 {color: #ff9c1b}span.s7 {color: #fe4fdd}</style>
=IFERROR(IF($E$131:$E$454=$P$82,INDEX($P$131:$P$454,MATCH(1,($C86=$C$131:$C$454)*($D86=$D$131:$D$454),0)),0),0)
So I'm at a loss as to why the first one works but the second doesn't. Any ideas are much appreciated.