njdevils3027
New Member
- Joined
- Jun 27, 2019
- Messages
- 3
[FONT="]Hi All,
[/FONT]
[FONT="]I am trying to set up an Excel formula based off of a mapping table. I have a set of "level 1" codes in my data set and can match them to the mapping table that also includes these "level 1" codes via a Vlookup. That takes care of about 75/80% of the data set.
[/FONT]
[FONT="]There are some lines of data that do not include this "level 1" code and I need to map it via a "level 2" code. However, this "level 2" code cannot be brought into the mapping table (for a separate reason).
[/FONT]
[FONT="]My solution was to vlookup based on the "level 1" code and then follow that statement with a series of IF(cell="X","Y) statements to catch all of the "level 2" codes. This formula will be used for many different files in the future so it is best for me to catch all in one formula rather than hard code over any N/A's in this file.
[/FONT]
[FONT="]I have no trouble BEGINNING the formula with the IF statements and ending it with the Vlookup. However, this overrides the Vlookup in the cases where the mapping does not align. I need a way for the Vlookup to be the FIRST function in the formula, with those IF's coming afterwards. Is that possible?
[/FONT]
[FONT="]Something like:[/FONT]
[FONT="]IFERROR(vlookup("level 1" cell,array from mapping table,count in mapping table, false), IF("level 2" cell="X","Y")
[/FONT]
[FONT="]I have not been able to get that to work. Is there a better way around it?[/FONT]
[/FONT]
[FONT="]I am trying to set up an Excel formula based off of a mapping table. I have a set of "level 1" codes in my data set and can match them to the mapping table that also includes these "level 1" codes via a Vlookup. That takes care of about 75/80% of the data set.
[/FONT]
[FONT="]There are some lines of data that do not include this "level 1" code and I need to map it via a "level 2" code. However, this "level 2" code cannot be brought into the mapping table (for a separate reason).
[/FONT]
[FONT="]My solution was to vlookup based on the "level 1" code and then follow that statement with a series of IF(cell="X","Y) statements to catch all of the "level 2" codes. This formula will be used for many different files in the future so it is best for me to catch all in one formula rather than hard code over any N/A's in this file.
[/FONT]
[FONT="]I have no trouble BEGINNING the formula with the IF statements and ending it with the Vlookup. However, this overrides the Vlookup in the cases where the mapping does not align. I need a way for the Vlookup to be the FIRST function in the formula, with those IF's coming afterwards. Is that possible?
[/FONT]
[FONT="]Something like:[/FONT]
[FONT="]IFERROR(vlookup("level 1" cell,array from mapping table,count in mapping table, false), IF("level 2" cell="X","Y")
[/FONT]
[FONT="]I have not been able to get that to work. Is there a better way around it?[/FONT]