+ Reply to Thread
Results 1 to 11 of 11

sum column based on condition with pipe divide & highlight code missing

  1. #1
    Forum Contributor
    Join Date
    04-18-2011
    Location
    London, England
    MS-Off Ver
    Excel 2016
    Posts
    105

    sum column based on condition with pipe divide & highlight code missing

    Hi, I am looking to find a solution below if someone could help please,

    1. On the report sheet I wish to sum column from sheet data based on condition in column B on the report with condition divided by pipe | .
    2. I also would like to highlight code missing in the report sheet on data tab highlighted in red.

    I have attached an example

    Thank you
    Attached Files Attached Files
    Last edited by nd4spd; 01-07-2021 at 02:57 PM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,055

    Re: sum column based on condition with pipe divide & highlight code missing

    No you haven't.... try again, after reading the yellow banner (top of page).
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Contributor
    Join Date
    04-18-2011
    Location
    London, England
    MS-Off Ver
    Excel 2016
    Posts
    105

    Re: sum column based on condition with pipe divide & highlight code missing

    Thanks Glenn uploaded the file

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,055

    Re: sum column based on condition with pipe divide & highlight code missing

    Now you have!!

    Part 1:

    =SUMPRODUCT(SUMIF(Data!B:B,FILTERXML("<a><b>"&SUBSTITUTE(B3,"|","</b><b>")&"</b></a>","//b"),Data!C:C))

    copied down.
    Attached Files Attached Files

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,055

    Re: sum column based on condition with pipe divide & highlight code missing

    In your real file, are there just 2 rows (B3 & B4) or many?

  6. #6
    Forum Contributor
    Join Date
    04-18-2011
    Location
    London, England
    MS-Off Ver
    Excel 2016
    Posts
    105

    Re: sum column based on condition with pipe divide & highlight code missing

    Thanks Glenn there are 2 more not relevant just descriptions for these codes.

    Code, Name, $year, $month
    Last edited by nd4spd; 01-07-2021 at 02:14 PM.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,055

    Re: sum column based on condition with pipe divide & highlight code missing

    I THINK you may have misunderstood my Q. You have 1 row:
    10|123|4321

    and another row:
    11|12

    are there any/many more. Of course, I may have misunderstood your answer!!

  8. #8
    Forum Contributor
    Join Date
    04-18-2011
    Location
    London, England
    MS-Off Ver
    Excel 2016
    Posts
    105

    Re: sum column based on condition with pipe divide & highlight code missing

    sorry yes there are many more codes but all unique and none repeated.

  9. #9
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: sum column based on condition with pipe divide & highlight code missing

    1. C3
    =SUMPRODUCT(ISNUMBER(FIND("|"&Data!$B$4:$B$9&"|","|"&B3&"|"))*Data!$C$4:$C$9)

    But Glenn's FILTERXML formula is faster.

    2. Conditional formatting formula applies to B4:B9
    =NOT(COUNT(FIND("|"&B4&"|","|"&report!$B$3:$B$5&"|")))
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    04-18-2011
    Location
    London, England
    MS-Off Ver
    Excel 2016
    Posts
    105

    Re: sum column based on condition with pipe divide & highlight code missing

    @ Bo_RY The conditional format seems to be working on some but not all even though I have tweaked it for the range "puzzled ?"

    Please Login or Register  to view this content.
    Last edited by nd4spd; 01-07-2021 at 06:58 PM.

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

    Re: sum column based on condition with pipe divide & highlight code missing

    Assuming that the formatting still starting in cell B4 on the DATA sheet and that the codes on the REPORT sheet are found in cells B3:B900, try the following:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    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] Highlight duplicate based on condition
    By rachelwahid in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 04-03-2020, 09:20 AM
  2. [SOLVED] VBA code to compare rows based on 4 column values and highlight is no match
    By Sirilias in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-16-2015, 02:22 PM
  3. [SOLVED] Excel VBA code required to re-arrange the data based on Column condition
    By mchilapur in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-28-2015, 03:48 AM
  4. [SOLVED] VBA Code to Delete a Column Based on a Condition
    By dosbirn in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 07-25-2013, 04:27 PM
  5. Divide value by range of values based on condition
    By T3Knical5urg3 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-26-2012, 08:15 PM
  6. Highlight the cell based on the specific condition
    By shaan65 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-25-2010, 02:07 AM
  7. Replies: 3
    Last Post: 08-07-2009, 12:03 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