I'm trying to write a formula that will look at a range of cells to see if any of them match a value, if so, I want to capture a value for that.
I put together some sample data below. What I want to do is to have the script in E1 look at all of the values in cells A5 to C9...if any of those cells contain the same value as A1, I want to show the value of the corresponding number's column heading (contained in row 3).
So, in the example below, the formula should return a result of "Thousands". The only result I can get, however, is "#Value!"
I'm copying this formula from another excel document where it works, so I'm not sure what the issue is.
[TABLE="class: grid, width: 100"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]3000[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]=INDEX(A3:C3,MAX(IF(A5:C9=A1,COLUMN(A5:C9))))[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Hundreds[/TD]
[TD]Thousands[/TD]
[TD]Tens of Thousands[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]100[/TD]
[TD]1000[/TD]
[TD]10000[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]200[/TD]
[TD]2000[/TD]
[TD]20000[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]300[/TD]
[TD]3000[/TD]
[TD]30000[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]400[/TD]
[TD]4000[/TD]
[TD]40000[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]500[/TD]
[TD]5000[/TD]
[TD]50000[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I put together some sample data below. What I want to do is to have the script in E1 look at all of the values in cells A5 to C9...if any of those cells contain the same value as A1, I want to show the value of the corresponding number's column heading (contained in row 3).
So, in the example below, the formula should return a result of "Thousands". The only result I can get, however, is "#Value!"
I'm copying this formula from another excel document where it works, so I'm not sure what the issue is.
[TABLE="class: grid, width: 100"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]3000[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]=INDEX(A3:C3,MAX(IF(A5:C9=A1,COLUMN(A5:C9))))[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Hundreds[/TD]
[TD]Thousands[/TD]
[TD]Tens of Thousands[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]100[/TD]
[TD]1000[/TD]
[TD]10000[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]200[/TD]
[TD]2000[/TD]
[TD]20000[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]300[/TD]
[TD]3000[/TD]
[TD]30000[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]400[/TD]
[TD]4000[/TD]
[TD]40000[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]500[/TD]
[TD]5000[/TD]
[TD]50000[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]