copying rows which contain a 4 digit number

tvhasben

New Member
Joined
Sep 30, 2008
Messages
14
I have downloaded my checking account for 2023 into excel. I have slept a lot since I last used excel and don't remember much from back in 2012. Anyway, I want to find all occurrences of debit card numbers in description column (D) and copy the contents of that row to another place in the worksheet so I can total up how our family spent money last year. The values in column D will look like this: "Netflix.com 01-02 netflix.com CA8026DEBIT CARD RECURRING PYMT". where 8026 is one of the card numbers. There may be a function or a formula to do this for me, but I don't know That's why I'm asking you.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Which version of Excel are you using? You should update your Account Details.
Can you provide more samples? Is the format consistent?
 
Upvote 0
I'm using Office 2021. Nearly all the entries follow a similar format where there is a space before the card number such as, "FOOD CITY #701 12-31-22 CHATTANOOGA TN 8142 DEBIT CARD PURCHASE-PIN", or "PAPA JOHN'S #0444 01-14 205-981-2844 TN 8142 DEBIT CARD PURCHASE". Some will have no card number as they were debited by PayPal. Some direct deposits will start with XX like "XXSOC SEC SSA TREAS 310 ASSA *************** ACH CREDIT". Those I can handle with a regular sort and manual copy/paste.
 
Upvote 0
Maybe this.
Book1
AB
1Netflix.com 01-02 netflix.com CA 8026 debit CARD RECURRING PYMT8026
2FOOD CITY #701 12-31-22 CHATTANOOGA TN 8142 DEBIT CARD PURCHASE-PIN8142
3PAPA JOHN'S #0444 01-14 205-981-2844 TN 8142 DEBIT CARD PURCHASE8142
Sheet8
Cell Formulas
RangeFormula
B1:B3B1=MID(A1,SEARCH("DEBIT",A1)-5,4)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,170
Members
453,021
Latest member
Justyna P

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