+ Reply to Thread
Results 1 to 7 of 7

Extract and concatenate data based on positive/negative data

  1. #1
    Registered User
    Join Date
    10-31-2012
    Location
    South Australia, Australia
    MS-Off Ver
    Excel 2016
    Posts
    49

    Extract and concatenate data based on positive/negative data

    Hi Team,

    I am looking for a solution to extract data from different cells in a row based on whether they are positive or negative (rise or fall in categories), then concatenate this data into a commentary line.

    Please see simplified sample attached.

    Thanks in Advance!
    Attached Files Attached Files

  2. #2
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: Extract and concatenate data based on positive/negative data

    What should it say if all are positive or negative?

  3. #3
    Registered User
    Join Date
    10-31-2012
    Location
    South Australia, Australia
    MS-Off Ver
    Excel 2016
    Posts
    49

    Re: Extract and concatenate data based on positive/negative data

    Hi Kersplash,
    I would be more than happy for it to leave the other portion out in those cases.
    ie. Sales have fallen (or risen) in State 2 (-2%), State 4 (-15%), State 5 (-7%).

    Cheers

  4. #4
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: Extract and concatenate data based on positive/negative data

    What about if a state is 0%?

  5. #5
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: Extract and concatenate data based on positive/negative data

    This might be better suited to VBA.

  6. #6
    Registered User
    Join Date
    10-31-2012
    Location
    South Australia, Australia
    MS-Off Ver
    Excel 2016
    Posts
    49

    Re: Extract and concatenate data based on positive/negative data

    Your most likely right about it being better suited to VBA but I was hoping to achieve it with formulas.
    There is no real need for 0% to be reported.

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

    Re: Extract and concatenate data based on positive/negative data

    Not exactly the expected outcome, but perhaps close enough.
    E6:E11 are populated using: =AGGREGATE(15,6,E$2:J$2,ROWS(A$1:A1))
    D6:D11 are populated using: =INDEX(E$1:J$1,MATCH(E6,E$2:J$2,0))
    F6:F11 are populated using: ="("&TEXT(E6,"0.0%")&")"
    G6:G11and H6:H11 are populated using formulas similar to: =IF(AND(E5<0,E6<0),I5&", "&D6&" "&F6,IF(E6<0,D6&" "&F6,""))
    I6:I11 and J6:J11 are populated using formulas similar to: =IF(G6<>"",I$5&" "&G6,"")
    C13 is populated using: =INDEX(I6:I11,AGGREGATE(14,6,(ROW(I6:I11)-ROW(I5))/(I6:I11<>""),1))&INDEX(J6:J11,AGGREGATE(14,6,(ROW(J6:J11)-ROW(J5))/(J6:J11<>""),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. Replies: 9
    Last Post: 03-05-2019, 03:23 PM
  2. Formula to compare positive and negative data
    By dewonw in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-23-2017, 11:54 AM
  3. [SOLVED] Separating positive and negative data
    By samra21 in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 09-28-2016, 11:57 AM
  4. Replies: 2
    Last Post: 08-19-2015, 11:56 AM
  5. How to extract matching negative and positive value that match across several columns
    By daisyhill in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-15-2014, 05:47 PM
  6. Replies: 2
    Last Post: 08-04-2014, 08:57 AM
  7. Comparing Counts of Negative vs Positive Data
    By jetsfan23 in forum Excel General
    Replies: 2
    Last Post: 01-26-2011, 10:01 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