Help with a VLOOKUP Formula

tbruce

Board Regular
Joined
Dec 9, 2013
Messages
77
Office Version
  1. 365
Platform
  1. Windows
So with help from the well of knowledge here, I was able to tackle my first issue of changing the first number in a value from one number to another, but now I'm looking to expand on the formula to handle a VLOOKUP to column A for a specific identifier "beta". If "beta" is present in the Type A column row & cell, then I want to apply the formula. If "beta" is not present (in this case "alpha" is), then simply copy the value from the Old Value B column cell to the New Value C column cell f the same row.

Any help you can provide to get me there would be much appreciated. Here is the current formula and an example data set:

=--REPLACE(J29,1,1,LEFT(J29,1)+OR(--LEFT(J29,1)={1,2,3}))

This works to change the first digit from the Old Value column cell from 1 to 2, 2 to 3 and 3 to 4 when I manually filter the Type A column to "beta" then apply the filter and copy the formula down.

I'm hoping someone can assist with a VLOOKUP to the current formula. I do need to copy ZERO as well if present. The current formula handles that, but need it to also copy ZERO when beta is not present and the value is ZERO in the Old Value column cell.

Hope this all makes sense.

ABC
1TypeOld ValueNew Value
2alpha0
3alpha20695
4alpha20695
5alpha20695
6alpha20695
7beta1066020660
8beta00
9beta00
10beta00
11beta3013940139
12alpha40139
13alpha0
14alpha0
15beta3013940139
16beta00
17beta00
18beta00
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Hi there
Not sure what you're needing to lookup with vlookup, maybe I need more information

=if(a2="Beta",if(isnumber(left(b2,1)),if(left(b2,1)<9,left(b2,1)+1 ,"0"),left(b2,1)) & mid(b2,2,len(b2)-1),b2)
 
Upvote 0
Try

20 09 10.xlsm
ABC
1TypeOld ValueNew Value
2alpha00
3alpha2069520695
4alpha2069520695
5alpha2069520695
6alpha2069520695
7beta1066020660
8beta00
9beta00
10beta00
11beta3013940139
12alpha4013940139
13alpha00
14alpha00
15beta3013940139
16beta00
17beta00
18beta00
IF_
Cell Formulas
RangeFormula
C2:C18C2=IF(A2="beta",--REPLACE(B2,1,1,LEFT(B2,1)+OR(--LEFT(B2,1)={1,2,3})),B2)
 
Upvote 0
You're welcome. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,707
Members
448,981
Latest member
recon11bucks

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top