INDEX Problem; Finding the 0th Result

Roseus

Board Regular
Joined
Dec 20, 2010
Messages
87
Summary: I have two identical INDEX formulas – one results in #VALUE, the other as a number. I think it’s caused by some malarkey where my formula tells Excel to find INDEX(Range,0).
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
Explanation:<o:p></o:p>
I was working with INDEX today. I have a report card of sorts, across 12 months. I have a table that contains all the goals a person is striving for. Depending on their rank, they will have more difficult goals. The formula uses their Rank to determine how far down the table to look using INDEX.
<o:p></o:p>
For my first test case (Joe), I only placed Rank data for January and February. The rest of the months just zeroed out like they’re supposed to – If(Rank=0,0,…) – except March. Instead of evaluating as a zero, it gave me #VALUE. I poked around and couldn’t figure out why, but left it alone.
<o:p></o:p>
When I created my second case test (Amy), all the months behaved as they were supposed to except March again – but this time it evaluated as a number! Same formula, same Goal table, same Rank – different result!<o:p></o:p>
I reviewed the error and evaluated the “working” formula, and then literally get to the same point, and then evaluate differently! I don’t understand it at all!
<o:p></o:p>
#VALUE:
If(Rank=0,0,(.55>(INDEX(‘Goal Table’!$E$25:$E$72,(0)))))
If(Rank=0,0, (.55>(#VALUE!)))
#VALUE
<o:p></o:p>
“Working”
If(Rank=0,0, (.55>(INDEX(‘Goal Table’!$E$25:$E$72,(0)))))
If(Rank=0,0, (.55>(.8799))) - - - .8799 is the Goal at this Rank.
1

<o:p></o:p>
Gets worse:<o:p></o:p>
I started trying to break down the problem (the above code is a snippet of a more complex formula) and isolate the problem. Each Rank is 12 cells long (12 months). Rank D is 1-12, C is 13-24, and so on (E25:E72).<o:p></o:p>
=INDEX('Sales Goals'!E25:E72,0)
0.9099<o:p></o:p>
=INDEX('Sales Goals'!E25:E36,0)
#VALUE<o:p></o:p>
This makes even less sense! .9099 is result 13 of 48 (first goal for Rank C). And reducing the range to just Rank D results in an error!

<o:p></o:p>
I’m really confused, help is appreciated!!<o:p></o:p>
 
Last edited:

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Why are you using zero as the row number? A zero would return the entire array, and #VALUE! would be returned unless the formula is confirmed with Ctrl+Shift+Enter, in which case the first item would be returned.
 
Upvote 0
The formula evaluates what Rank each individual is at, which then determines the row number. If the Rank is C and the month is January, the INDEX knows to look 13 rows down.

Rank is reported at the end of the month. So right now in March, the Rank is "0". Doesn't exist yet.

I'm perfectly fine with it always returning a #VALUE. My concern is not that there's an error, but that using the same data it errors once, and provides a Rating the other time (a Rating is a number 1-5 measuring to what degree your goal was met).

I want two errors, if you follow me. It's the inconsistancy in results from the same data that I don't understand.
 
Upvote 0
It will only return a result other than #VALUE! if it's confirmed with Ctrl+Shift+Enter. If it is Excel will surround it with curly braces {}.
 
Upvote 0
I didn't set it up as an array, and it is still returning a value, rather than #VALUE.

Here's the full formula for both (preceeded by a key):

  • G20/G32 indicate Performance.
  • B20 indicates their Rank. A 63 needs a higher Performance than a 60.
  • G25:G72 is the Goals table.
  • Report Card A# is simply numbers for the INDEX. A4 equals 1, A16 equals 13, etc.
=IF(G20=0,"",(G20>0)+(G20>(INDEX('Sales Goals'!$E$25:$E$72,((B20=60)*('Report Card'!$A$4)+(B20=61)*('Report Card'!$A$16)+(B20=62)*('Report Card'!$A$34)+(B20=63)*('Report Card'!$A$46)))))+(G20>(INDEX('Sales Goals'!$F$25:$F$72,((B20=60)*('Report Card'!$A$4)+(B20=61)*('Report Card'!$A$16)+(B20=62)*('Report Card'!$A$34)+(B20=63)*('Report Card'!$A$46)))))+(G20>(INDEX('Sales Goals'!$G$25:$G$72,((B20=60)*('Report Card'!$A$4)+(B20=61)*('Report Card'!$A$16)+(B20=62)*('Report Card'!$A$34)+(B20=63)*('Report Card'!$A$46)))))+(G20>(INDEX('Sales Goals'!$H$25:$H$72,((B20=60)*('Report Card'!$A$4)+(B20=61)*('Report Card'!$A$16)+(B20=62)*('Report Card'!$A$34)+(B20=63)*('Report Card'!$A$46))))))
Returns #VALUE.


=IF(G32=0,"",(G32>0)+(G32>(INDEX('Sales Goals'!$E$25:$E$72,((B32=60)*('Report Card'!$A$4)+(B32=61)*('Report Card'!$A$16)+(B32=62)*('Report Card'!$A$34)+(B32=63)*('Report Card'!$A$46)))))+(G32>(INDEX('Sales Goals'!$F$25:$F$72,((B32=60)*('Report Card'!$A$4)+(B32=61)*('Report Card'!$A$16)+(B32=62)*('Report Card'!$A$34)+(B32=63)*('Report Card'!$A$46)))))+(G32>(INDEX('Sales Goals'!$G$25:$G$72,((B32=60)*('Report Card'!$A$4)+(B32=61)*('Report Card'!$A$16)+(B32=62)*('Report Card'!$A$34)+(B32=63)*('Report Card'!$A$46)))))+(G32>(INDEX('Sales Goals'!$H$25:$H$72,((B32=60)*('Report Card'!$A$4)+(B32=61)*('Report Card'!$A$16)+(B32=62)*('Report Card'!$A$34)+(B32=63)*('Report Card'!$A$46))))))
Returns 1

You can see that the only difference is where they are located (one looks at G20 and B20, the other at G32 and B32. Everything else is the same.

Since neither are encased in { }, since they are not arrays, what else might explain why they don't both provide #VALUE?

Note: I intentionally left off the CODE tags so it is more legible. Otherwise it renders as one loooong sentence. This is easier to understand.
 
Upvote 0
Since neither are encased in { }, since they are not arrays, what else might explain why they don't both provide #VALUE?

Maybe because
=OR(B32={60;61;62;63}) is True
and
=OR(B20={60;61;62;63}) is False

So in the second formula you dont have a INDEX(Range,0)

M.
 
Upvote 0
I would use Formula Auditing and Evaluate Formula to establish the cause of the error. It's difficult for me to check because I don't have your workbook.
 
Upvote 0
B32 and B20 are both 0. It shouldn't be able to figure out the formula because there's no 60, 61, 62, or 63.

I used the formula auditing to watch each step of the formula. They get to the same step and resolve differently, which boggles my mind!

#VALUE:
If(Rank=0,0,(.55>(INDEX(‘Goal Table’!$E$25:$E$72,(0)))))

If(Rank=0,0, (.55>(#VALUE!)))
#VALUE
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
“Working”
If(Rank=0,0, (.55>(INDEX(‘Goal Table’!$E$25:$E$72,(0)))))
If(Rank=0,0, (.55>(.8799))) - - - .8799 is the Goal at this Rank.
1

I was hoping there was a known bug using 0 in an Index, but it sounds like we won't be able to get to the bottom of this. Thanks anyway!
 
Upvote 0
Hi,

“Working”
If(Rank=0,0, (.55>(INDEX(‘Goal Table’!$E$25:$E$72,(0)))))

If(Rank=0,0, (.55>(.8799))) - - - .8799 is the Goal at this Rank.
1

Is it possible this formula produce 1 as result?
If Rank = 0 ----> 0
If Rank<> 0 -----> (.55>(.8799)) = False

M.
 
Upvote 0
Are you asking if it's possible for the formula to correctly output a 1, when the Rank is not a 0 - yes, perfectly acceptable.

If the Rank was 60, and they had performed at 55%, they would be rated a 1.

However, it should not be able to determine .8799, or any other goals, unless the Rank is 60-63.

So it's not so much "<>0" as "=60,61,62,63" - anything else should result in an error.
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,834
Members
452,947
Latest member
Gerry_F

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