Issue with IF and VLookup Formula

hammerhead13

Board Regular
Joined
Aug 4, 2008
Messages
86
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
  2. Mobile
What I am trying to accomplish is for it to check to see if the Cell Starts with "4300" to Return the Data. If it does not then I want to Add the Prefix "4300" to the Cell. I can't see what I have Wrong. I need another set of more experienced Eyes. Thank you in advance!

=IF(LEFT(VLOOKUP($B$8,'Data Dump'!$B$2:$N$6000,10,FALSE),4))="4300", VLOOKUP($B$8,'Data Dump'!$B$2:$N$6000,10,FALSE),4), &"4300" &VLOOKUP($B$8,'Data Dump'!$B$2:$N$6000,10,FALSE),4)
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Try
Excel Formula:
=IF(LEFT(VLOOKUP($B$8,'Data dump'!$B$2:$N$6000,10,FALSE),4)="4300", VLOOKUP($B$8,'Data dump'!$B$2:$N$6000,10,FALSE), "4300" &VLOOKUP($B$8,'Data dump'!$B$2:$N$6000,10,FALSE))
 
Upvote 0
Why dont you shorten the formula like this?

=IF(LEFT(VLOOKUP($B$8,'Data Dump'!$B$2:$N$6000,10,FALSE),4)="4300", "","4300")&VLOOKUP($B$8,'Data Dump'!$B$2:$N$6000,10,FALSE)

So regardless of what the VLOOKUP result is you either concatenate a null or 4300 to the start.
 
Upvote 0
Try

=IF(LEFT(VLOOKUP($B$8,'Data Dump'!$B$2:$N$6000,10,FALSE),4)="4300", VLOOKUP($B$8,'Data Dump'!$B$2:$N$6000,10,FALSE), "4300" &VLOOKUP($B$8,'Data Dump'!$B$2:$N$6000,10,FALSE))
 
Upvote 0
If the 4300 can only exist as the first 4 characters you can use
Excel Formula:
="4300"&SUBSTITUTE(VLOOKUP($B$8,'Data dump'!$B$2:$N$6000,10,FALSE),"4300","")
 
Upvote 0
Try
Excel Formula:
=IF(LEFT(VLOOKUP($B$8,'Data dump'!$B$2:$N$6000,10,FALSE),4)="4300", VLOOKUP($B$8,'Data dump'!$B$2:$N$6000,10,FALSE), "4300" &VLOOKUP($B$8,'Data dump'!$B$2:$N$6000,10,FALSE))
I see where I messed up. I forgot I had ",4)" on my last 2 Vlookups which I needed to Remove. that's the problem with Copy and Pasting and not paying closer attention. Thank you very much!


Thank you everyone for your assistance!!!
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,322
Messages
6,124,241
Members
449,149
Latest member
mwdbActuary

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