Forum

Notifications
Clear all

Vlookup net

14 Posts
4 Users
0 Reactions
78 Views
(@david_ng)
Posts: 310
Reputable Member
Topic starter
 

How to vlookup the net amount when the code  is matched, ie report the net amount to be collected and report outstanding?

ie the code consisted a positive or negative balance.

 
Posted : 05/01/2018 8:20 pm
(@david_ng)
Posts: 310
Reputable Member
Topic starter
 

The formula exrpessed in  a VB code, if possible

 
Posted : 05/01/2018 8:24 pm
Philip Treacy
(@philipt)
Posts: 1629
Member Admin
 

Hi David,

When posting a macro enabled workbook please don't password protect the VBA modules.  The first thing I do when I download an xlsm is open it with macros disabled, then check the code to see if there's anything malicious in there.

As I can't do this with your workbook I have removed it as I can't vouch for the VBA code.

I'm not saying there was anything malicious in there, but I need to check and make sure.

Please re-upload the file so we can check the code.

Thx

Phil

 
Posted : 05/01/2018 8:32 pm
(@shaowu459)
Posts: 44
Eminent Member
 

MsgBox Application.WorksheetFunction.VLookup("search value", Range("A1:B100"), 2, 0)

hope this is what you want

 
Posted : 05/01/2018 8:39 pm
(@david_ng)
Posts: 310
Reputable Member
Topic starter
 

Sorry, file decrypt for your reference.

 

In short  I hope a formula can vlookup the net bal of the code ( in teh dabase worksheet] if Code matched  in the Report sheet.  

 
Posted : 05/01/2018 10:03 pm
(@david_ng)
Posts: 310
Reputable Member
Topic starter
 

Any chance to set this formula ?

 
Posted : 06/01/2018 2:05 am
(@sunnykow)
Posts: 1417
Noble Member
 

Hi David

You should give us the actual expected result as your report amount does not tally with the AR Database.

Why don't you just use a Pivot Table to summarize the AR Database instead of using formulas (or is it VBA that you want)?

Sunny

 
Posted : 06/01/2018 2:44 am
(@david_ng)
Posts: 310
Reputable Member
Topic starter
 

Because we must use the format designated by Headoffice, pivot table format NOT accepted

So what we want is to insert the Code Net balance from the AR Database to the Report Layout, but using Vlookup we can only map one balance into the Report.

 

Preferably we can using VBA to automate the mapping process ie insert the net balance of each Code from AR dabase to fit into the Report layout.  

 
Posted : 06/01/2018 5:06 am
(@sunnykow)
Posts: 1417
Noble Member
 

Can you attach your actual expected result? VERY IMPORTANT

Which columns are you matching to get the net balance?

Is your attachment the actual format? It has merged cells and may cause some difficulties. I also notice your values have both USD and YEN.

Sorry for so many questions, need to be clear about what you want

Sunny

 
Posted : 06/01/2018 7:23 am
(@sunnykow)
Posts: 1417
Noble Member
 

Hi David

Give this a try. To prevent double/triple summing, I am matching the code in each cell of column B against the cell above.

If it is the same (duplicate), it will not sum. This will only work if the codes in column B are sorted.

Hope this helps.

Sunny

 
Posted : 06/01/2018 8:48 pm
(@david_ng)
Posts: 310
Reputable Member
Topic starter
 

Thank Sunny wil give it a try, to see if work .. 

 
Posted : 08/01/2018 8:37 pm
(@david_ng)
Posts: 310
Reputable Member
Topic starter
 

After a bit modificaion to incorporate the formula you set up, finally did work out well in the Report template, our deep thanks to you Sunny again.

 
Posted : 10/01/2018 2:00 am
(@sunnykow)
Posts: 1417
Noble Member
 

Hi David

You are welcome. Glad to know you are able to figure it out.

Cheers

Sunny

 
Posted : 10/01/2018 2:24 am
(@david_ng)
Posts: 310
Reputable Member
Topic starter
 

I think many agreed in the Forum, your methodology to tackle the problem is compresensive enough to Excel users...

Make life a lot easier ...

 
Posted : 10/01/2018 2:54 am
Share: