milanpatel17
New Member
- Joined
- Sep 14, 2013
- Messages
- 9
Hello,
I am trying to write a formula which gives value based on two criteria, one in row and one in column. The row title remains in same cell but the row title may come in different cell. How to get the value even if the column title move in other cell?
I can use simple vlookup or Hlookup but what in case the Male column shifts to female column and vice versa. I am using this formula but getting #N/A:
=INDEX($B$1:$C$7,MATCH($G2&H$1,INDEX($A$2:$A$7&$B$1:$C$1,),0))
What formula shall I use to get the value in table 2 from table 1.
Table 1 Table 2
[TABLE="width: 576"]
<colgroup><col width="64" span="9" style="width:48pt"> </colgroup><tbody>[TR]
[TD="width: 64"][/TD]
[TD="width: 64"]Male[/TD]
[TD="width: 64"]Female[/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"]Female[/TD]
[TD="width: 64"]Male[/TD]
[/TR]
[TR]
[TD]Price[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]35[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Price[/TD]
[TD="align: center"]#N/A[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Age[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]40[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Age[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Income[/TD]
[TD="align: right"]15[/TD]
[TD="align: right"]45[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Income[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Home[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]50[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Home[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Married[/TD]
[TD="align: right"]25[/TD]
[TD="align: right"]55[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Married[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Single[/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]60[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Single[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Your assistance in this regard will be highly appriciated.
Thanks in advance
Milan
I am trying to write a formula which gives value based on two criteria, one in row and one in column. The row title remains in same cell but the row title may come in different cell. How to get the value even if the column title move in other cell?
I can use simple vlookup or Hlookup but what in case the Male column shifts to female column and vice versa. I am using this formula but getting #N/A:
=INDEX($B$1:$C$7,MATCH($G2&H$1,INDEX($A$2:$A$7&$B$1:$C$1,),0))
What formula shall I use to get the value in table 2 from table 1.
Table 1 Table 2
[TABLE="width: 576"]
<colgroup><col width="64" span="9" style="width:48pt"> </colgroup><tbody>[TR]
[TD="width: 64"][/TD]
[TD="width: 64"]Male[/TD]
[TD="width: 64"]Female[/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"][/TD]
[TD="width: 64"]Female[/TD]
[TD="width: 64"]Male[/TD]
[/TR]
[TR]
[TD]Price[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]35[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Price[/TD]
[TD="align: center"]#N/A[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Age[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]40[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Age[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Income[/TD]
[TD="align: right"]15[/TD]
[TD="align: right"]45[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Income[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Home[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]50[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Home[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Married[/TD]
[TD="align: right"]25[/TD]
[TD="align: right"]55[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Married[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Single[/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]60[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Single[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Your assistance in this regard will be highly appriciated.
Thanks in advance
Milan