The
Rules sheet
Row\Col | B | D | E |
2 | NAME_L | GL (6 digit) | SGL (6 digit) |
3 | DISBURSING AUTHORITY | 101000 | 101000 |
4 | NON 224 COLLECTIONS | 102400 | 101000 |
5 | LIABILITY- NON-ENTITY ASSETS | 298500 | 298500 |
6 | Expense | 610000 | 610000 |
Row\Col | G | H | I |
2 | # Characters | Definition | # Loc |
3 | 6 | GL ACCOUNT NUMBER | 29 |
4 | 21 | DOLLAR AMOUNT | 35 |
5 | 1 | DEBIT CREDIT INDICATOR | 56 |
6 | 4 | MAIN ACCOUNT CODE | 22 |
7 | 13 | FULL MAIN ACCOUNT CODE + GL ACCOUNT NUMBER | 22 |
01. D3:E6 is named
GLXwlk (The definition is yours.)
02. H2 is changed from SGL ACCOUNT NUMBER to GL ACCOUNT NUMBER (Correction).
03. The range in G:I is extended with the last record FULL MAIN ACCOUNT CODE + GL ACCOUNT NUMBER.
04. The relevant cells are in G and I are named as follows:
G2, I2 >>
GLLen,
GLLoc
G3, I3 >>
AmountLen,
AmountLoc
G4, I4 >>
DCILen,
DCILoc
G5, I5 >>
MACLen,
MACLoc
G6, I6 >>
fullMACLen,
fullMACLoc
The
TB sheet (which houses both the input and the processing/output)
INPUT
Row\Col | A |
1 | Text File |
2 | 201506 075 2473000101000000000000002196975429CB G0990000 |
3 | 201506 075 2473000101000000000000002196975429DB N |
4 | 201506 075 2473000101000000000000002196975429CE G0990000 |
5 | 201506 075 2473000101000000000000002196975429DE N |
6 | 201506 075 2450000102400000000000000029232203CE G0990000 |
7 | 201506 075 2473000610000000000000005654931203DE N |
8 | 201506 075 2473000610000000000000001298705828DE F017 |
9 | 201506 075 2480000298500000000000002705814212DB F017 A |
10 | 201506 075 2475000298500000000000000248806994DB F097 A |
11 | 201506 075 2475000298500000000000001407724339DB G0990000 A |
12 | 201506 075 2475000103500000000000000015000000DB G0990000 A |
<tbody>
</tbody>
05. A2:A12 is named
VAATB (The definition is yours.)
06. Ivec (from integer vector, see Formulas | Name Manager) is defined as follows:
Rich (BB code):
=ROW(VAATB)-ROW(INDEX(VAATB,1,1))+1
Row\Col | D | E | F | G |
1 | 6 | | | |
2 | GL | SGL | Fund | Grand Total |
3 | 101000 | 101000 | 2473 | $ - |
4 | 102400 | 101000 | 2450 | $ 292,322.03 |
5 | 610000 | 610000 | 2473 | $ (69,536,370.31) |
6 | 298500 | 298500 | 2480 | $ (27,058,142.12) |
7 | 298500 | 298500 | 2475 | $ (16,565,313.33) |
8 | 103500 | No Match | 2475 | $ (150,000.00) |
9 | | | | |
10 | | | | |
11 | | | | |
12 | | | | |
<tbody>
</tbody>
PROCESSING/OUTPUT (D:G)
07. D1, control+shift+enter, not just enter:
Rich (BB code):
=SUM(IF(FREQUENCY(IF(VAATB<>"",MATCH(MID(VAATB,fullMACLoc,fullMACLen),
MID(VAATB,fullMACLoc,fullMACLen),0)),Ivec),1))
08. D3, control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IF(ROWS($D$3:D3)<=$D$1,INDEX(MID(VAATB,GLLoc,GLLen),
SMALL(IF(FREQUENCY(IF(VAATB<>"",MATCH(MID(VAATB,fullMACLoc,fullMACLen),
MID(VAATB,22,13),0)),Ivec),Ivec),ROWS($D$3:D3))),"")
Warning. Do not attempt to eliminate this output range.
Warning. Do not replace ROWS($D$3:D3) with something non-robust like ROW(A1) or ROW(1:1) or less intelligible ROW($1:1).
09. E3, just enter and copy down:
Rich (BB code):
=IF(D3="","",IFERROR(VLOOKUP(D3,GLXwlk,2,0),"No Match"))
10. F3, control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IF(D3="","",INDEX(MID(VAATB,MACLoc,MACLen),
SMALL(IF(FREQUENCY(IF(VAATB<>"",MATCH(MID(VAATB,fullMACLoc,fullMACLen),
MID(VAATB,fullMACLoc,fullMACLen),0)),Ivec),Ivec),ROWS($D$3:D3))))
11. G3, control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IF(D3="","",
SUM(IF(ISNUMBER(SEARCH(F3&"*"&D3,MID(VAATB,fullMACLoc,fullMACLen))),
(MID($A$2:$A$12,AmountLoc,AmountLen)/100)*
IF(MID(VAATB,DCILoc,DCILen)="D",-1,1))))
12. See the workbook that implements the foregoing at:
https://dl.dropboxusercontent.com/u/65698317/legalhustler Copy of Sample Data 6.18.15 aa.xlsx
Please do not start another thread on this matter.