+ Reply to Thread
Results 1 to 6 of 6

Searching for "patterns" in Excel

  1. #1
    Registered User
    Join Date
    07-20-2018
    Location
    Texas
    MS-Off Ver
    MSOffice 2016
    Posts
    8

    Searching for "patterns" in Excel

    Hello! I'm sorry but I couldn't find my answer in the search box.

    I am new to Excel but I want to learn more so that I can give our auditors and analysts a well deserved break. Plus I can get what I need quicker since they are often busy

    I am analyzing a spreadsheet that shows a person's trips (I removed and altered the data in the attached spreadsheet). I just finished reviewing a spreadsheet to see if it had any possible mistakes due to this spreadsheet's total $ amount being different from other records. The spreadsheet had over 900 rows and I looked over each of them manually to see if I could notice any mistakes. I found 3 possible problem areas (which I highlighted). I do not know if the data was inputted incorrectly or if the other records are wrong. But I am hoping to verify everything that I can. In order to be more efficient I was wondering if there is a way to search for patterns in an excel spreasheet?
    Specifically for this case I want to see if one row is related to the one above. For this spreadsheet I wanted to make sure that the Trip Dates column each had a matching pair (so if there was a 04/08/18 there should be a 04/08/18 in the row below it). I also wanted to see if the Trip ID column had a corresponding ****-A and ****-B (**** being the same) in the row below it. I spent a lot of time doing this manually but I was hoping that there was a way to automate it?

    Thank you for your time!
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Searching for "patterns" in Excel

    Hi, welcome to the forum

    This (I think) would be the basis of your formula...
    =AND(A3=A4,LEFT(B3,LEN(B3)-1)=LEFT(B4,LEN(B4)-1))

    However, it also flagging the next row down (for the next "set") as not matching

    Will there always only ever be 2 "matches" in your list?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Searching for "patterns" in Excel

    This check for matching A/B pairs:

    A
    B
    C
    D
    E
    1
    Trip Date Trip Id Status
    258
    02/11/2016 01-120734-C Verified-Paid
    FALSE
    D258: =COUNTIF(B257:B259, LEFT(B258, LEN(B258) - 1) & IF(RIGHT(B258) = "A", "B", IF(RIGHT(B258)="B","A"))) = 1
    337
    05/31/2016 01-116719-C Verified-Paid
    FALSE
    370
    06/29/2016 01-106939-A Verified-Paid
    FALSE
    371
    06/29/2016 01-106939-C Verified-Paid
    FALSE
    644
    06/08/2017 01-102583-C Verified-Paid
    FALSE
    803
    11/27/2017 01-117241-A Verified-Paid
    FALSE
    804
    11/28/2017 01-108828-A Verified-Paid
    FALSE
    Last edited by shg; 07-20-2018 at 04:20 PM.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    07-20-2018
    Location
    Texas
    MS-Off Ver
    MSOffice 2016
    Posts
    8

    Re: Searching for "patterns" in Excel

    FDibbins/SHG,

    Thank you both for your responses! I wanted to reply to you both before I looked utlized what you both answered (since I know its going to take some time for me to understand it lol).

    FDibbins - there should only be two for trips for each corresponding date. But there might be multiple trips (two parts) on the same date. But there is one instance in which there are 3 trips for that corresponding date (i think this is a mistake since everything else is just two parts.

    I apologize if it's a little confusing lol..... Basically a person is driving themself from their home to another location. That person should only have those two trips and they get reimbursed for the drive from their home to that location and the drive from that location home. Those two trips take place on that same date.

    *I apologize but I didn't know that I couldn't give you both reputation for your help : /

  5. #5
    Registered User
    Join Date
    07-20-2018
    Location
    Texas
    MS-Off Ver
    MSOffice 2016
    Posts
    8

    Re: Searching for "patterns" in Excel

    Quote Originally Posted by shg View Post
    This check for matching A/B pairs:

    A
    B
    C
    D
    E
    1
    Trip Date Trip Id Status
    258
    02/11/2016 01-120734-C Verified-Paid
    FALSE
    D258: =COUNTIF(B257:B259, LEFT(B258, LEN(B258) - 1) & IF(RIGHT(B258) = "A", "B", IF(RIGHT(B258)="B","A"))) = 1
    337
    05/31/2016 01-116719-C Verified-Paid
    FALSE
    370
    06/29/2016 01-106939-A Verified-Paid
    FALSE
    371
    06/29/2016 01-106939-C Verified-Paid
    FALSE
    644
    06/08/2017 01-102583-C Verified-Paid
    FALSE
    803
    11/27/2017 01-117241-A Verified-Paid
    FALSE
    804
    11/28/2017 01-108828-A Verified-Paid
    FALSE
    Thats it! You found more instances that I didn't even notice! Thank you for your help. I just don't understand how you did it yet lol. I'm trying to look up the formulas right now.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Searching for "patterns" in Excel

    Im happy you got what you needed, and thanks for the feedback

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Excel 2010 -- "Visual Basic" "Macros" and "Record Macro" all disabled.
    By NicholasL in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-07-2017, 06:11 AM
  2. [SOLVED] Column X-Ref list - Sheet1 Col A "pages", Col B:FL "Req" to Sheet2 ColA "req", ColB "page"
    By excel-card-pulled in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-07-2017, 09:30 AM
  3. [SOLVED] Excel 2007: How to Convert "5/2/2013" to "May" then subtract a Month so it's "Apr"
    By Golom in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-19-2013, 02:00 AM
  4. [SOLVED] Data mining, sorting, "how do I identify random patterns"?
    By Larbec in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-03-2013, 08:09 AM
  5. Replies: 1
    Last Post: 09-21-2013, 03:18 AM
  6. Find correct patterns with "?" as a wildcard
    By Hitch75 in forum Excel General
    Replies: 5
    Last Post: 07-05-2010, 11:12 AM
  7. Chart "patterns" in 2007
    By Beeblebrox in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 12-27-2007, 08:18 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1