I have two sheets, sheet1 and sheet2, each containing information about tickets. Both sheets contain a column containing ticket numbers.
The data in sheet2 is a subset of that in sheet1. It contains a series of columns that define the status of a ticket, such as used, refunded, exchanged.
The tickets are listed in column B and the status is defined in the column header (C1:M1) like so:
In sheet1, I have a larger group of tickets with a variety of information. I need to add a column to this sheet that will return the status of the ticket as defined in sheet2.
Additionally, if a ticket on sheet1 is not present in sheet2, I need to return the status "UN". Also, if a ticket is present on sheet2, but there is no "X" in any column, I needs to return the value "OP".
Presently, I am doing this across two rather messy formulae:
1. Write the status to a cell in a new column in sheet 2 (N)
{=IF(ISNA(INDEX('sheet2'!$D$1:$M$1,MATCH(TRUE,'sheet2!D2:M2="X ",0))),"OP",INDEX('sheet2'!$D$1:$M$1,MATCH(TRUE,'sheet2'!D2:M2="X ",0)))}
2. Do a vlookup on to this value from sheet 1
=IF(ISNA(VLOOKUP(K2,'sheet2'!$B$2:$N$145,13,FALSE)),"UN",(VLOOKUP(K2,'sheet2'!$B$2:$N$145,13,FALSE)))
I am totally stumped as to how to do this in a single formula (or even if it is worth putting it in one)...
I have no idea whether the next two questions have mutually exclusive answers but it boils down to this:
A) Can any one suggest a more elegant solution?
B) Does any one know if it would be possible to combine these formulae?
The data in sheet2 is a subset of that in sheet1. It contains a series of columns that define the status of a ticket, such as used, refunded, exchanged.
The tickets are listed in column B and the status is defined in the column header (C1:M1) like so:
Code:
-------------------------------------------------
|Ca |Frm/SerNo |VK|VX|EX|ER|RF|CR|TR|CX|NR|RR|AC|
-------------------------------------------------
|000|nnnnnnnnn1|X | | |X | | | | | | | |
|000|nnnnnnnnn2|X | | |X | | | | | | | |
|000|nnnnnnnnn3|X | | | |X | | | | | | |
|000|nnnnnnnnn4|X | | | | | | | | | |X |
|000|nnnnnnnnn5|X | | | | | | | | | | |
|000|nnnnnnnnn6|X | | | | | | | | | |X |
-------------------------------------------------
In sheet1, I have a larger group of tickets with a variety of information. I need to add a column to this sheet that will return the status of the ticket as defined in sheet2.
Additionally, if a ticket on sheet1 is not present in sheet2, I need to return the status "UN". Also, if a ticket is present on sheet2, but there is no "X" in any column, I needs to return the value "OP".
Presently, I am doing this across two rather messy formulae:
1. Write the status to a cell in a new column in sheet 2 (N)
{=IF(ISNA(INDEX('sheet2'!$D$1:$M$1,MATCH(TRUE,'sheet2!D2:M2="X ",0))),"OP",INDEX('sheet2'!$D$1:$M$1,MATCH(TRUE,'sheet2'!D2:M2="X ",0)))}
2. Do a vlookup on to this value from sheet 1
=IF(ISNA(VLOOKUP(K2,'sheet2'!$B$2:$N$145,13,FALSE)),"UN",(VLOOKUP(K2,'sheet2'!$B$2:$N$145,13,FALSE)))
I am totally stumped as to how to do this in a single formula (or even if it is worth putting it in one)...
I have no idea whether the next two questions have mutually exclusive answers but it boils down to this:
A) Can any one suggest a more elegant solution?
B) Does any one know if it would be possible to combine these formulae?