Excel to do Ledger

sythong

Active Member
Joined
Jun 26, 2004
Messages
324
Wondering whether this can be done.

Have the following data layout
Sht1

[Date] [Doc] [Debit] [Dr AMt] [Credit] [Cr Amt]
[1.1.06] [100] [Debtor] [10] [ Sale] [ -10]
[2.2.06] [201] [Debtor] [20] [Sale] [-20]
[1.3.06] [R01] [Bank ] [30 ] [Debtor] [-30]

In Sht2 I do a dropdown list. When I return

Debtor (in dropdown box)

Want it to return in Ledger format

[Date] [Doc ] [Dr Amt] [Cr Amt] [Sub-total]
[1.1.06] [100] [ 10] [ 0 ] [10]
[2.2.06] [201] [20] [ 0 ] [30]
[1.3.06] [R01] [0] [-30 ] [0]

I am inclined that this could be possible through a mix
of indirect iserror match vlookup index.

Thanks
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Selamat pagi sythong,

This is easy via a query table. No formulas - uses database functionality.

I've done a sample file and will try and email it to you.

Fazza
 
Upvote 0
Fazza

I think you have a winner on your hands.
After tinkering with it I found that it is indeed possible
to generate a ledger from the database.

Unfortunately since I do not have any knowledge of writing codes
I am unable to structure for what I am to achieve. I do need to
put in additional columns and also the drop down list needs to
be expanded to include all items in the debit credit column.

Regards.
 
Upvote 0
Thong,

I have emailed you an updated file. As mentioned in the email, additional fields were added by modifying the query tables' SQL string. Which will not mean much if you are not familiar with Query Tables and SQL.

By way of explanation, I called the source data table MD and had the following parameterized SQL - linked to the single cell where the debtor is selected from the data validation list. The single cell has a header field and the two cell table/range is called Db. Note, this is to suit the example posted above, not the extra fields subsequently added. The data validation list feeding into the single cell is generated by another query table - a list of distinct entries in the data table fields of [Debit] and [Credit]. The query table refreshes on changes to the single cell and this use of query tables offers in a deceptively simple way powerful database functionality.

HTH
Fazza

SELECT MD.Date, MD.Doc, MD.`Dr Amt`,0 AS [Cr Amt]
FROM `H:\file`.MD MD,`H:\file`.Db Db
WHERE (MD.Debit=?) AND (MD.Debit=Db.Debtor)
UNION ALL
SELECT MD.Date, MD.Doc, 0 AS [Dr Amt], MD.`Cr Amt`
FROM `H:\file`.MD MD,`H:\file`.Db Db
WHERE (MD.Credit=?) AND (MD.Credit=Db.Debtor)
ORDER BY MD.Date
 
Upvote 0
Fazza

I am really grateful to you for pointing me in the
right direction. Will look up MS Query and SQL to
familarise myself so that I can expand upon your
existing structure.

This would really cut down a lot of work as all incoming
XL files such as sales, purchase, cash and bank can
be cut and paste and voila the GL can be generated.
I am also looking into creating the P&L and Balance Sheet
once I reached the level of understanding required to
formulate these.

Once again many many thanks for your time and expertise
in coming up with such a pratical and amazing solution.

Regards.


Thong
 
Upvote 0
Fazza

Thanks. You are extremely kind and helpful.
Just what I needed. Additional info to steer me in the
right direction.

Thong
 
Upvote 0

Forum statistics

Threads
1,214,904
Messages
6,122,169
Members
449,070
Latest member
webster33

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