hendrik1985
New Member
- Joined
- Jul 10, 2010
- Messages
- 4
Hello experts,
In some worksheets where I use a vlookup function, it returns #N/A, because the format of the cells differs, some formatted as text, some as numbers, especially in query data.
With the following formula, I get a value, no matter the format.
=IF(ISTEXT(D2),VLOOKUP(VALUE(D2),$A$1:$B$5,2,0),VLOOKUP(TEXT(D2,"#"),$A$2:$B$5,2,0))
To work easy with this formula, I would like to make a user defined function (UDF) of this formula, but I dont know exactly how to do this.
Who can help me please?
Thanks in advance for your help.
Best regards, Hendrik
In some worksheets where I use a vlookup function, it returns #N/A, because the format of the cells differs, some formatted as text, some as numbers, especially in query data.
With the following formula, I get a value, no matter the format.
=IF(ISTEXT(D2),VLOOKUP(VALUE(D2),$A$1:$B$5,2,0),VLOOKUP(TEXT(D2,"#"),$A$2:$B$5,2,0))
To work easy with this formula, I would like to make a user defined function (UDF) of this formula, but I dont know exactly how to do this.
Who can help me please?
Thanks in advance for your help.
Best regards, Hendrik