+ Reply to Thread
Results 1 to 26 of 26

help needed with doing a line by line comparison

  1. #1
    Registered User
    Join Date
    04-16-2013
    Location
    United Kingdom
    MS-Off Ver
    365
    Posts
    93

    help needed with doing a line by line comparison

    Hi,

    I have 2 datasets, A&B.

    I would like to sum all the costs (cell c) per identifier (b) in cell D and then do the same for data set b in column E so I can compare them line by line.

    The problem I have is the identifier repeats itself in columns B and F and I don't know how to handle that part.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: help needed with doing a line by line comparison

    Please show us what you want by filling in expected results manually.

    On the face of it, I don't see how this differs from the SUMIF I provided in your earlier thread.

    Maybe this in D8

    =SUMIF($B$8:$B$15,B8,$C$8:$C$15)

    and this in E8:

    =SUMIF($F$8:$F$15,B8,$G$8:$G$15)
    Last edited by AliGW; 11-14-2023 at 05:00 AM.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    04-16-2013
    Location
    United Kingdom
    MS-Off Ver
    365
    Posts
    93

    Re: help needed with doing a line by line comparison

    Thanks Ali.

    I would like the formula to ignore cell D and E if the identifier repeats itself and just returns one figure per identifier.

    I've greyed out the ones I need to ignore, also amended the formula in column E to reference column G.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: help needed with doing a line by line comparison

    The workbook hasn't changed - you need to upload it again if you have amended it!

  5. #5
    Registered User
    Join Date
    04-16-2013
    Location
    United Kingdom
    MS-Off Ver
    365
    Posts
    93

    Re: help needed with doing a line by line comparison

    attaching a new sheet.
    Attached Files Attached Files

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: help needed with doing a line by line comparison

    Try:

    =IF(COUNTIF($B$8:$B8,B8)=1,SUMIF($B$8:$B$15,B8,$C$8:$C$15),"")

    and:

    =IF(D8="","",SUMIF($F$8:$F$15,B8,$G$8:$G$15))

    or:

    =IF(COUNTIF(F$8:F8,F8)=1,SUMIF($F$8:$F$16,F8,$G$8:$G$16),"")
    Last edited by AliGW; 11-14-2023 at 06:17 AM.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: help needed with doing a line by line comparison

    You could try this in J8:

    =LET(u,UNIQUE(B8:B15),sa,SUMIF(B8:B15,u,C8:C15),sb,SUMIF(F8:F16,u,G8:G16),VSTACK({"Identifier","Cost A","Cost B"},HSTACK(u,sa,sb)))

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    04-16-2013
    Location
    United Kingdom
    MS-Off Ver
    365
    Posts
    93

    Re: help needed with doing a line by line comparison

    thanks, it worked, is there a way I can put column E and in the same order so I can compare the quantities line by line?
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    04-16-2013
    Location
    United Kingdom
    MS-Off Ver
    365
    Posts
    93

    Re: help needed with doing a line by line comparison

    #and D, sorry typo

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: help needed with doing a line by line comparison

    This from post #6 puts them in the same order:

    Try:

    =IF(COUNTIF($B$8:$B8,B8)=1,SUMIF($B$8:$B$15,B8,$C$8:$C$15),"")

    and:

    =IF(D8="","",SUMIF($F$8:$F$15,B8,$G$8:$G$15))
    This from post #7 creates a handy comparison table:

    =LET(u,UNIQUE(B8:B15),
    sa,SUMIF(B8:B15,u,C8:C15),
    sb,SUMIF(F8:F16,u,G8:G16),VSTACK({"Identifier","Cost A","Cost B"},
    HSTACK(u,sa,sb)))
    Could you please try to state exactly what you want at the start of the thread and MOCK IT UP in the workbook in future instead of drip feeding changes to the original request?
    Attached Files Attached Files
    Last edited by AliGW; 11-14-2023 at 08:10 AM. Reason: Workbook added.

  11. #11
    Registered User
    Join Date
    04-16-2013
    Location
    United Kingdom
    MS-Off Ver
    365
    Posts
    93

    Re: help needed with doing a line by line comparison

    yes, it was not deliberate, once I started I realized my original hypothesis was wrong.

    I tried to replicate the LET formula on my sheet and for some reasons I cannot make it work.

    Can you please rewrite it, by flipping columns B and C, on the dataset I'm working on Cost is on column B and Identifier is on column C, I had it the wrong way round when I shared the sheet

    thank you
    Attached Files Attached Files

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: help needed with doing a line by line comparison

    I keep asking you to manually MOCK UP the results you want. Please do so - there is NO mock-up in the attachment. I also need to see the formula you tried to manipulate - I cannot troubleshoot without seeing what you did.

    If it's just a case of flipping columns, then I am very surprised that you were unable to change the bits in red accordingly:

    Please Login or Register  to view this content.
    Last edited by AliGW; 11-14-2023 at 09:40 AM.

  13. #13
    Registered User
    Join Date
    04-16-2013
    Location
    United Kingdom
    MS-Off Ver
    365
    Posts
    93

    Re: help needed with doing a line by line comparison

    I amended the data + reattached a new sheet, sorry for the confusion
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    04-16-2013
    Location
    United Kingdom
    MS-Off Ver
    365
    Posts
    93

    Re: help needed with doing a line by line comparison

    Hi, the below worked thanks so much

    LET(u,UNIQUE(C8:C15),
    sa,SUMIF(C8:C15,u,B8:B15),
    sb,SUMIF(F8:F16,u,G8:G16),VSTACK({"Identifier","Cost A","Cost B"},
    HSTACK(u,sa,sb)))

    how can I add a second criteria to the second part? please see cell F

    Thank you
    Attached Files Attached Files

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: help needed with doing a line by line comparison

    Yet again you have failed to manually mock up what you are looking for. I have no idea how you expect to incorporate the colours.

    I'm not going to waste time trying to guess.

    Provide a mock-up with annotations to explain properly what you are after.

  16. #16
    Registered User
    Join Date
    04-16-2013
    Location
    United Kingdom
    MS-Off Ver
    365
    Posts
    93

    Re: help needed with doing a line by line comparison

    Hi Ali, I'm sorry if I have confused you on this thread. In the attached, I have used your LET formula but I would like to add 1 more criteria to it.
    I would like to to get the results in column L instead of column K by ignoring the ones in column E=Red
    thanks
    Attached Files Attached Files

  17. #17
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: help needed with doing a line by line comparison

    Thank you - at last a mock-up of what you want!

    Try this:

    Please Login or Register  to view this content.

  18. #18
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: help needed with doing a line by line comparison

    So I think you've seen this proposed solution - any feedback? Just a 'thanks' would do for starters - some acknowledgement of my continued efforts on your behalf ...

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

  19. #19
    Registered User
    Join Date
    04-16-2013
    Location
    United Kingdom
    MS-Off Ver
    365
    Posts
    93

    Re: help needed with doing a line by line comparison

    WOW it worked!, I just managed to look at it, you are a superstar thank you so so much.

    You saved me a ton of time, brilliant

  20. #20
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: help needed with doing a line by line comparison

    Glad to have helped.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

  21. #21
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: help needed with doing a line by line comparison

    Further to your PM:

    Please Login or Register  to view this content.
    LET allows us to create parameters:

    u,UNIQUE(C8:C15) - u is the unique items from the range C8 to C15
    sa,SUMIF(C8:C15,u,B8:B15) - sa is the sum of each of the unique items in the column B range
    sb,SUMIFS(G8:G16,F8:F16,u,E8:E16,"<>Red") - sb is the sum of the unique items in column G where column E is not Red

    Then we vertically stack the labels on top of the columns, which are brought together in the horizontal stack.

    Hope this helps.

    If you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

  22. #22
    Registered User
    Join Date
    04-16-2013
    Location
    United Kingdom
    MS-Off Ver
    365
    Posts
    93

    Re: help needed with doing a line by line comparison

    much appreciated, learning everyday from you! thank you

  23. #23
    Registered User
    Join Date
    04-16-2013
    Location
    United Kingdom
    MS-Off Ver
    365
    Posts
    93

    Re: help needed with doing a line by line comparison

    Hi Ali, I would like to add one more criteria if possible.

    I added 1 more column to the last file I shared with , column H.

    I would like to to get the results in column L by ignoring the ones in column E=Red and H= 06/11/2023

    Thanks
    Attached Files Attached Files

  24. #24
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: help needed with doing a line by line comparison

    Not too sure about your expected results, but this?

    Please Login or Register  to view this content.

  25. #25
    Registered User
    Join Date
    04-16-2013
    Location
    United Kingdom
    MS-Off Ver
    365
    Posts
    93

    Re: help needed with doing a line by line comparison

    Perfect it did what I was looking for.
    Thank you!

  26. #26
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: help needed with doing a line by line comparison

    Great stuff.

+ 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. data comparison when new line added
    By Janur1490 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-07-2021, 08:38 AM
  2. [SOLVED] Extract Multi-line data and date comparison
    By chilli16 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-23-2018, 12:23 PM
  3. Replies: 3
    Last Post: 03-12-2017, 03:39 PM
  4. [SOLVED] Comparing two data sets that don't line up on a line to line basis
    By ghan7650 in forum Excel General
    Replies: 10
    Last Post: 05-22-2012, 05:38 PM
  5. Replies: 1
    Last Post: 04-11-2012, 10:26 AM
  6. Stumped on how to create a horizontal line comparison chart
    By quaffin1 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 04-25-2009, 08:39 AM
  7. Macro problem on, Yellowed line - previous line or next line.
    By Ed in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-29-2005, 07:06 PM

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