Hello all-<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
This is my first post here, but I have been browsing for the past couple of weeks at my new job. I am an intern in the accounting/finance department at a publicly traded company here in the US and we are currently working on reducing waste in business processes. One of those processes revolves around exporting data from SAP into Excel, fixing some of the data, and then removing irrelevant data. I am using Excel 2010 on Windows XP SP 3.
The first step I have set up is to check if any of the data needs to be reformatted (it is missing a “0” in the middle of the number). I have the formula as follows, and it works correctly (Column M in dummy data below)
<o></o>
From there, I use a nested IF based on the column for the above formula. That formula is as follows (Column N in dummy data below)
<o></o>
I have that column conditionally formatted to show “IRRELEVANT” with a red fill, and up to this point I have absolutely no problems and the formulas appear to work correctly. However, from there, I must manually delete all “IRRELEVANT” rows to get out the data for our specific facility. If this were a few rows it wouldn’t be a big deal but the raw data is ~2000 rows and my manually cleansed data is ~600 rows, so as you can see I am manually clearing out quite a bit of data.<o></o>
This is a process that is done monthly, and while I believe a macro is the best way to do this, I don’t have any experience writing macros/using VBA. I consider myself a strong Excel user, but I am not an expert.<o></o>
Below is some dummy data so you have a better idea of what I am talking about:
Excel 2010
Thanks in advance for any assistance!
<o></o>
This is my first post here, but I have been browsing for the past couple of weeks at my new job. I am an intern in the accounting/finance department at a publicly traded company here in the US and we are currently working on reducing waste in business processes. One of those processes revolves around exporting data from SAP into Excel, fixing some of the data, and then removing irrelevant data. I am using Excel 2010 on Windows XP SP 3.
The first step I have set up is to check if any of the data needs to be reformatted (it is missing a “0” in the middle of the number). I have the formula as follows, and it works correctly (Column M in dummy data below)
Code:
=IF(OR(LEFT(C2,6)="104001",LEFT(C2,6)="104003",LEFT(C2,6)="104004"),CONCATENATE("CTR ",LEFT(C2,2),"0",MID(C2,3,4)),D2)
From there, I use a nested IF based on the column for the above formula. That formula is as follows (Column N in dummy data below)
Code:
=IF(OR(M2="CTR 1004001",M2="CTR 1004003",M2="CTR 1004004"),M2,IF(AND(RIGHT(D2,5)>="12475",RIGHT(D2,5)<="12739"),D2,"IRRELEVANT"))
I have that column conditionally formatted to show “IRRELEVANT” with a red fill, and up to this point I have absolutely no problems and the formulas appear to work correctly. However, from there, I must manually delete all “IRRELEVANT” rows to get out the data for our specific facility. If this were a few rows it wouldn’t be a big deal but the raw data is ~2000 rows and my manually cleansed data is ~600 rows, so as you can see I am manually clearing out quite a bit of data.<o></o>
This is a process that is done monthly, and while I believe a macro is the best way to do this, I don’t have any experience writing macros/using VBA. I consider myself a strong Excel user, but I am not an expert.<o></o>
Below is some dummy data so you have a better idea of what I am talking about:
Excel Workbook | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
B | C | D | E | F | G | H | I | J | K | L | M | N | |||
1 | Cost Element | Name | AuxAcctAs1 | Name of offsetting account | Offst.acct | Order | OffAct | CoCd | Val.in rep.cur. | Postg Date | Created on | Formatting Fix | Relevant? | ||
2 | Facilities | 10357E EN DUMMY DATA | 139670 | 1000 | 9,956.00 | 05/31/2011 | 06/02/2011 | IRRELEVANT | |||||||
3 | Facilities | 104004-PRJ DUMMY DATA | 156295 | 1000 | 2,645.00 | 05/31/2011 | 06/01/2011 | CTR 1004004 | CTR 1004004 | ||||||
4 | Fringe | 10384 BD DUMMY DATA | 115746 | 1000 | 21.56 | 05/31/2011 | 06/02/2011 | IRRELEVANT | |||||||
5 | Fringe | 10436 RD DUMMY DATA | 115746 | 1000 | 545.21 | 05/31/2011 | 06/02/2011 | IRRELEVANT | |||||||
6 | General | JCTE000204193 | CTR 12708 | A/P AMCL | 210036 | 154710 | S | 1000 | 5.89 | 05/04/2011 | 05/05/2011 | CTR 12708 | CTR 12708 | ||
7 | General | JCTE000204193 | CTR 1004003 | A/P AMCL | 210036 | 156295 | S | 1000 | 16.67 | 05/04/2011 | 05/05/2011 | CTR 1004003 | CTR 1004003 | ||
8 | General | JCTE000204193 | CTR 1004003 | A/P AMCL | 210036 | 157010 | S | 1000 | 6.28 | 05/04/2011 | 05/05/2011 | CTR 1004003 | CTR 1004003 | ||
9 | Other | 104003_DSTDUMMYDATA | 156430 | 1000 | -2,215.65 | 05/31/2011 | 06/02/2011 | CTR 1004003 | CTR 1004003 | ||||||
10 | Other | 12335_DST DISTRDUMMY DATA | 156950 | 1000 | -312.45 | 05/31/2011 | 06/02/2011 | IRRELEVANT | |||||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
M2 | =IF(OR(LEFT(C2,6)="104001",LEFT(C2,6)="104003",LEFT(C2,6)="104004"),CONCATENATE("CTR ",LEFT(C2,2),"0",MID(C2,3,4)),D2) | |
N2 | =IF(OR(M2="CTR 1004001",M2="CTR 1004003",M2="CTR 1004004"),M2,IF(AND(RIGHT(D2,5)>="12475",RIGHT(D2,5)<="12739"),D2,"IRRELEVANT")) |
Thanks in advance for any assistance!
<o></o>
Last edited: