ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Modify Vlookup (https://www.excelbanter.com/excel-programming/435108-modify-vlookup.html)

Charles

Modify Vlookup
 
Hi,
I need some help in modifying a vlookup formula the following code
works however I need to modify it so that when the cell in "Like
Store" (B2) is blank the code will place the cell value of Rounded of
"3886" in place of the #N/A.



VLOOKUP(B2,A$2:C655,3,FALSE) This is in the column for "Final
Weighting"


Store Like Store Weighting Weighting % Reduction Weighting - %
Rounded Final Weighting
1001 1006 39142
10 35227.8 35228 39414
1002 1001 36606
10 32945.4 32946 39142
1003 38858
90 3885.8 3886 #N/A

Dave Peterson

Modify Vlookup
 
=if(b2="","what does rounded of 3886 mean?",vlookup(....))


Charles wrote:

Hi,
I need some help in modifying a vlookup formula the following code
works however I need to modify it so that when the cell in "Like
Store" (B2) is blank the code will place the cell value of Rounded of
"3886" in place of the #N/A.

VLOOKUP(B2,A$2:C655,3,FALSE) This is in the column for "Final
Weighting"

Store Like Store Weighting Weighting % Reduction Weighting - %
Rounded Final Weighting
1001 1006 39142
10 35227.8 35228 39414
1002 1001 36606
10 32945.4 32946 39142
1003 38858
90 3885.8 3886 #N/A


--

Dave Peterson

Charles

Modify Vlookup
 
On Oct 18, 1:16*pm, Dave Peterson wrote:
=if(b2="","what does rounded of 3886 mean?",vlookup(....))



Charles wrote:

Hi,
I need some help in modifying a vlookup formula the following code
works however I need to modify it so that when the cell in "Like
Store" (B2) is blank the code will place the cell value of Rounded of
"3886" in place of the #N/A.


VLOOKUP(B2,A$2:C655,3,FALSE) This is in the column for "Final
Weighting"


Store * Like Store * * *Weighting * * * Weighting % Reduction * Weighting - %
Rounded Final Weighting
1001 * *1006 * * * * * * *39142
10 * * * * * * * * * * * * 35227.8 * * * * * *35228 * * * * 39414
1002 * *1001 * * * * * * *36606
10 * * * * * * * * * * * * 32945.4 * * * * * *32946 * * * * 39142
1003 * * * * * * * * * * * * * * *38858
90 * * * * * * * * * * * * * 3885.8 * * * * * 3886 * * * * * * * * * #N/A


--

Dave Peterson


Hi,

Thanks for the response. it looks like the format of the worksheet did
not carry over in the post.
The "3886 is the value I want to replace the N/A with.
The worksheet format starts in column A thru G.
In column G i have the Vlookup code VLOOKUP(B2,A$2:C655,3,FALSE) .
This work fine, but now I would like to for it to say if the cell
value in column B is "" to instead of putting "#N/A" In Column G it
will Put the value of column F which will be in the same row as the
blank cell in column B.

Rick Rothstein

Modify Vlookup
 
Put this formula in G2 and copy it down...

=IF(B2="",F2,VLOOKUP(B2,A$2:C655,3,FALSE))

This is the same formula that Dave posted with your VLOOKUP function call
substituted in and F2 replacing the question he asked in the second argument
to the IF function.

--
Rick (MVP - Excel)


"Charles" wrote in message
...
On Oct 18, 1:16 pm, Dave Peterson wrote:
=if(b2="","what does rounded of 3886 mean?",vlookup(....))



Charles wrote:

Hi,
I need some help in modifying a vlookup formula the following code
works however I need to modify it so that when the cell in "Like
Store" (B2) is blank the code will place the cell value of Rounded of
"3886" in place of the #N/A.


VLOOKUP(B2,A$2:C655,3,FALSE) This is in the column for "Final
Weighting"


Store Like Store Weighting Weighting % Reduction Weighting - %
Rounded Final Weighting
1001 1006 39142
10 35227.8 35228 39414
1002 1001 36606
10 32945.4 32946 39142
1003 38858
90 3885.8 3886 #N/A


--

Dave Peterson


Hi,

Thanks for the response. it looks like the format of the worksheet did
not carry over in the post.
The "3886 is the value I want to replace the N/A with.
The worksheet format starts in column A thru G.
In column G i have the Vlookup code VLOOKUP(B2,A$2:C655,3,FALSE) .
This work fine, but now I would like to for it to say if the cell
value in column B is "" to instead of putting "#N/A" In Column G it
will Put the value of column F which will be in the same row as the
blank cell in column B.


Rick Rothstein

Modify Vlookup
 
Actually, I kind of think the ending row of your lookup range should be
absolute like the beginning row is...

=IF(B2="",F2,VLOOKUP(B2,A$2:C$655,3,FALSE))

--
Rick (MVP - Excel)


"Rick Rothstein" wrote in message
...
Put this formula in G2 and copy it down...

=IF(B2="",F2,VLOOKUP(B2,A$2:C655,3,FALSE))

This is the same formula that Dave posted with your VLOOKUP function call
substituted in and F2 replacing the question he asked in the second
argument to the IF function.

--
Rick (MVP - Excel)


"Charles" wrote in message
...
On Oct 18, 1:16 pm, Dave Peterson wrote:
=if(b2="","what does rounded of 3886 mean?",vlookup(....))



Charles wrote:

Hi,
I need some help in modifying a vlookup formula the following code
works however I need to modify it so that when the cell in "Like
Store" (B2) is blank the code will place the cell value of Rounded of
"3886" in place of the #N/A.


VLOOKUP(B2,A$2:C655,3,FALSE) This is in the column for "Final
Weighting"


Store Like Store Weighting Weighting % Reduction Weighting - %
Rounded Final Weighting
1001 1006 39142
10 35227.8 35228 39414
1002 1001 36606
10 32945.4 32946 39142
1003 38858
90 3885.8 3886 #N/A


--

Dave Peterson


Hi,

Thanks for the response. it looks like the format of the worksheet did
not carry over in the post.
The "3886 is the value I want to replace the N/A with.
The worksheet format starts in column A thru G.
In column G i have the Vlookup code VLOOKUP(B2,A$2:C655,3,FALSE) .
This work fine, but now I would like to for it to say if the cell
value in column B is "" to instead of putting "#N/A" In Column G it
will Put the value of column F which will be in the same row as the
blank cell in column B.



Charles

Modify Vlookup
 
On Oct 18, 1:57*pm, "Rick Rothstein"
wrote:
Put this formula in G2 and copy it down...

=IF(B2="",F2,VLOOKUP(B2,A$2:C655,3,FALSE))

This is the same formula that Dave posted with your VLOOKUP function call
substituted in and F2 replacing the question he asked in the second argument
to the IF function.

--
Rick (MVP - Excel)

"Charles" wrote in message

...
On Oct 18, 1:16 pm, Dave Peterson wrote:



=if(b2="","what does rounded of 3886 mean?",vlookup(....))


Charles wrote:


Hi,
I need some help in modifying a vlookup formula the following code
works however I need to modify it so that when the cell in "Like
Store" (B2) is blank the code will place the cell value of Rounded of
"3886" in place of the #N/A.


VLOOKUP(B2,A$2:C655,3,FALSE) This is in the column for "Final
Weighting"


Store Like Store Weighting Weighting % Reduction Weighting - %
Rounded Final Weighting
1001 1006 39142
10 35227.8 35228 39414
1002 1001 36606
10 32945.4 32946 39142
1003 38858
90 3885.8 3886 #N/A


--


Dave Peterson


Hi,

Thanks for the response. it looks like the format of the worksheet did
not carry over in the post.
The "3886 is the value I want to replace the N/A with.
The worksheet format starts in column A thru G.
In column G i have the Vlookup code *VLOOKUP(B2,A$2:C655,3,FALSE) .
This work fine, but now I would like to for it to say if the cell
value in column B is "" to instead of putting *"#N/A" In Column G it
will Put the value of column F which will be in the same row as the
blank cell in column B.


Rick,

Thanks for the code it works.
Also thanks to all who responded to my request.


All times are GMT +1. The time now is 03:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com