Forum Discussion
AlokBeheria
May 09, 2023Brass Contributor
Conditional Vlookup
Hello All, I am trying to perform a conditional vlookup based on values. For example, I want to fetch server name from another sheet and only want to use vlookup where the columns shows only "nul...
- May 10, 2023
So a formula couldn't do that in the same cell where the NULL appears. Instead, you need to add what we often call a "helper column".
Then, in that helper column you'd write your VLOOKUP formula, and, assuming that column B contains the reference to use in VLOOKUP, and that column C contains the "null" value, the resulting formula would go something like
=IF(C11="null", VLOOKUP(B11,othertable,offset,0),C11)
This would retain whatever value is in column C where that value is not "null" but, if it is "null", replace it with whatever is in that remote table where you're performing the lookup.
If that doesn't help you, might I request that you post a copy of the workbook (including both sheets) on OneDrive or GoogleDrive, with a link pasted here that grants access.
AlokBeheria
May 10, 2023Brass Contributor
Thanks a ton for your valuable inputs and I was able to achieve desired results and now I was able to fetch values from other sheet ,but now I have a task to do where I need to replace all NULLS with it's corresponding values. Like in given below sheet , rows with "null's" needs to be replaced with "phazd0255lx01.phibred.com" values.
Server | New values |
phazd0255lx01.phibred.com | phazd0255lx01.phibred.com |
phazd0255lx01.phibred.com | phazd0255lx01.phibred.com |
null | phazd0255lx01.phibred.com |
phazd0255lx01.phibred.com | phazd0255lx01.phibred.com |
phazd0255lx01.phibred.com | phazd0255lx01.phibred.com |
Regards
mathetes
May 10, 2023Silver Contributor
The "New Values" column has all the correct values, right?
So you could just leave that as the column to use.
The alternative, if this is a once-and-done situation, is to copy from there to the original "Server" column, but make sure you use "Paste Special...Values" rather than plain "Paste"