+ Reply to Thread
Results 1 to 6 of 6

How to count amended data without repeats

  1. #1
    Registered User
    Join Date
    04-29-2020
    Location
    London
    MS-Off Ver
    2020
    Posts
    6

    Exclamation How to count amended data without repeats

    Can anyone help me, I am trying to understand some key info on a very large spreadsheet (image below).

    It is all about an order review system- there are three main columns for me: A. order number. B. Initial order type and C.Final order type.

    I want to know how many orders that come in as Type 1 are changed to type 2, and 3. And vice-versa: how many are changed to Type 1 from 2 or 3. (Type 1 is my main concern here).

    The problem is, before now, every-time any change was made to an order, this order was reproduced onto a new row in the sheet (when changes may not have happened to the actual order type, but rather the details). Another issue is that a lot of orders come in with the type as blank in column B. This blank order is then assigned a type in column C (so does not count as having changed).

    I need to know:
    -How many individual orders there are in total (some orders won't change of course)
    -How many individual Type 1 jobs were recorded at the beginning of the process (column B)
    -How many individual Type 1 jobs were recorded at the end of the process (column C)
    -How many individual jobs changed from type 1, to type 2 or 3
    -As well as how many changed from Type 2/3 to type 1.
    Not counting repeats or blanks.

    I started doing this with filters (see pic) and a count of how many have been changed (excluding blanks), then how many began as type 1 and became a different type, and how many began as type 2/3 and ended up as type 1, but I keep being tripped up by repeats. I also tried simply removing duplicates, but then it indiscriminately removes repeats and can remove the repeated list item that shows the type change. I have tried for a long time on this and have reached my limit of understanding; are there any excel braniacs out there who can share a simple solution?

    Screenshot 2020-04-30 at 02.45.00.png

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,165

    Re: How to count amended data without repeats

    Hi Roger and welcome to the forum,

    If you can attach the file it is a lot easier to work on your problem. Read the yellow at the top of the page for instructions.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: How to count amended data without repeats

    Are you REALLY using the latest Excel version, which would be from Office 365? If so, you have new worksheet functions FILTER and UNIQUE. Use them.

    Distinct order numbers
    =ROWS(UNIQUE($A$2:$A$100001))

    Distinct order numbers initially Type 1
    =ROWS(UNIQUE(FILTER($A$2:$A$100001,$B$2:$B$100001="Type 1")))

    Distinct order numbers ultimately Type 1
    =ROWS(UNIQUE(FILTER($A$2:$A$100001,$C$2:$C$100001="Type 1")))

    Distinct order numbers initially Type 1 which become Type 2/3
    =ROWS(UNIQUE(FILTER($A$2:$A$100001,($B$2:$B$100001="Type 1")*(($C$2:$C$100001="Type 2")+($C$2:$C$100001="Type 3")))))

    Distinct order numbers initially Type 2/3 which become Type 1
    =ROWS(UNIQUE(FILTER($A$2:$A$100001,($C$2:$C$100001="Type 1")*(($B$2:$B$100001="Type 2")+($B$2:$B$100001="Type 3")))))

    If you're using Office 2019 (there is no Office 2020 AFAIK), there's no FILTER or UNIQUE. How is your data sorted when there are multiple instances of the same order number in column A?

  4. #4
    Registered User
    Join Date
    04-29-2020
    Location
    London
    MS-Off Ver
    2020
    Posts
    6

    Re: How to count amended data without repeats

    Thank you so much for this; I do have Office 365, and those seem to work; I have two questions though, how can I make sure an array works on my mac (recent change, know on a PC you press shift enter)

    and, the first one gives a different number than pressing 'remove duplicates' from column A (in the data tab); why is this?

    Thanks so much for your help; this is a huge weight off my mind!

  5. #5
    Registered User
    Join Date
    04-29-2020
    Location
    London
    MS-Off Ver
    2020
    Posts
    6

    Re: How to count amended data without repeats

    Hi! Please see attached sample, with the arrays suggested below
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,522

    Re: How to count amended data without repeats

    In the attached file three helper columns, which may be moved and/or hidden for aesthetic purposes have been added.
    The first column shows how many times an order number is entered using: =COUNTIFS(A$2:A2,A2)
    The second column shows the initial order type using: =IF(G3>1,B3,B2)
    The third column shows the final order type using: =IF(G3>1,C3,C2)
    Formula for distinct orders: =COUNTIFS(G2:G1213,1)
    Formula for distinct orders initially type 1: =COUNTIFS(G2:G1213,1,H2:H1213,"Type 1")
    Formula for distinct orders ultimately type 1: =COUNTIFS(G2:G1213,1,I2:I1213,"Type 1")
    Formula for Type 1 > Type 2/3: =SUM(COUNTIFS(G2:G1213,1,H2:H1213,"Type 1",I2:I1213,"Type 2"),COUNTIFS(G2:G1213,1,H2:H1213,"Type 1",I2:I1213,"Type 3"))
    Formula for Type 2/3 > Type 1: =SUM(COUNTIFS(G2:G1213,1,H2:H1213,"Type 2",I2:I1213,"Type 1"),COUNTIFS(G2:G1213,1,H2:H1213,"Type 3",I2:I1213,"Type 1"))
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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] Userform unable to update amended data
    By nancyching1711 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-01-2018, 09:27 AM
  2. VBA code for Count the number of string repeats
    By VINOTHBASKRAN in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-24-2014, 03:25 AM
  3. Count If Number Repeats in 5 Day Period
    By SalientAnimal in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-13-2013, 08:39 AM
  4. [SOLVED] How to copy amended data to new worksheet
    By vijaynadiad in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-10-2013, 01:28 PM
  5. count the number of repeats
    By sweetness34 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-03-2013, 03:59 PM
  6. Count of Field Avoiding Repeats
    By ScottLor in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 04-22-2013, 11:46 AM
  7. [SOLVED] How can I count the number of repeats in a list of data?
    By SouthCarolina in forum Excel General
    Replies: 7
    Last Post: 03-07-2006, 06:10 PM

Tags for this Thread

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