Usung Vllokup to look up Value

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,601
Office Version
  1. 2021
Platform
  1. Windows
I have used the following formula to look up the account number in col B and to give me the value of the account number which appears in workbook BR1TB. It gives me a value #N/A.

For eg Acc # 102535 should give me a value of -3470.42


I have attached some sample data. It would be appreciated if someone can assist me

Sales COS Account Numbers.xls
ABCD
2OldAcc#NewAcc#Amount
33000102535#N/A
430010#N/A
53002102520#N/A
63003102560#N/A
73004102525#N/A
83005102565#N/A
NV Sales



BR1TB.xls
ABCDE
437102535SALES-RETAIL-151623-4545.8-3470.42
438102536SALES-Q-FLEET000
439102537FACTINCQ1-3722.22-222.222-87.6543
440102540SALES-L1-RETAIL-71298.5-3267.04-1657.01
NISSTB
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Hi howard,

For me works. Seeing the formula in the image, maybe is missing the sheet name within the reference.
Excel Workbook
ABC
2Old Acc #New Acc #Amount
33000102535-3470.42
430010
53002102520
63003102560
73004102525
83005102565
...
Cell Formulas
RangeFormula
C3=VLOOKUP(B3,[BR1TB.xls]SheetName!$A:$E,5,FALSE)


Hope this helps,

Regards
 
Upvote 0
Hi,

If the workbook is opened you can use something like

=VLOOKUP(B3,'[BR1TB.xls]NISSTB'!$A:$E,5,FALSE)

(as apparently there are no spaces neither in workbook-name nor in the sheet-name you could omit the apostrophes ' ' . I used them just in case.)


If the worbook is closed you need the path, for example

=VLOOKUP(B3,'C:\My Files\[BRITB.xls]NISSTB'!$A:$E,5,FALSE)


M.
 
Upvote 0
Thanks for the reply. I have used the formula =VLOOKUP(B3,[BRTB1.xls]Br1tb!$A$1:$E$65536,5,FALSE) and it gives me #N/A

See my sample files below. The Account number may be in numeric format, resulting in the error. it would be appreciated if you could assist me

Account Numbers.xls
ABCD
1NVSales
2OldAcc#NewAcc#Amount
33000102535Br1tb!$A$1:$E$65536,5,FALSE)]#N/A
430010#N/A
53002102520#N/A
63003102560#N/A
73004102525#N/A
83005102565#N/A
93006102505#N/A
103007102500#N/A
113008102550#N/A
NV Sales


BR1TB.xls
ABCDE
1102522FACINCENT-N1-3904.19-555.556-99.1055
2102525SALES--RETAIL-70097.2-11282.6-1808.44
3102526SALES-FLT000
4102527FACINC-5822.22-1111.11-154.074
5102535SALES-RETAIL-151623-4545.8-3470.42
6102536SALES-Q-FLEET000
7102537FACTINCQ1-3722.22-222.222-87.6543
8102540SALES-L1-RETAIL-1298.45-3267.04-101.456
Br1tb
 
Upvote 0
Hi Aladin

The formula works perfectly. I have aapted this formula for another workbook to

=IF(ISNA(VLOOKUP(B3+0,NISSTB.xls!$A:$E,4,FALSE)),0,(VLOOKUP(B3+0,NISSTB.xls!$A:$E,4,FALSE)))

However if If have an account # with text in between the account number for eg 10G506,
10G516 etc, the result comes up as #value!

It would be appreciated if you could assist me in resolving this problem



 
Upvote 0
Hi Aladin

The formula works perfectly. I have aapted this formula for another workbook to

=IF(ISNA(VLOOKUP(B3+0,NISSTB.xls!$A:$E,4,FALSE)),0,(VLOOKUP(B3+0,NISSTB.xls!$A:$E,4,FALSE)))

However if If have an account # with text in between the account number for eg 10G506,
10G516 etc, the result comes up as #value!

It would be appreciated if you could assist me in resolving this problem



Generic...
Code:
=LOOKUP(9.99999999999999E+307,CHOOSE({1,2},0,
    VLOOKUP(IF(ISNUMBER(B3+0),B3+0,B3),NISSTB.xls!$A:$E,4,0)))

If you are on 2007 or later...
Code:
=IFERROR(VLOOKUP(IF(ISNUMBER(B3+0),B3+0,B3),NISSTB.xls!$A:$E,4,0),0)
 
Upvote 0
Hi Aladin

You're a star. The formula works perfectly. I have learnt something new about Vlookups today

Regards

Howard
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,828
Members
452,946
Latest member
JoseDavid

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