+ Reply to Thread
Results 1 to 8 of 8

Commentary and If statements

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

    Commentary and If statements

    Hi Gurus,

    I am looking to create some automated reports from data in a spreadsheet and was looking for some assistance.

    I am concatenating text and data to form the reports and would like to base that commentary on data in cells.
    ie- If the total sales have increased this month then list the drivers of the increase.

    eg Total Sales increased 5% this month and were driven by an increase of 6% in car sales and a decrease of 1% in bike sales.

    Conversely, i would like to put the bike sales first if they were causing the increase.

    eg Total sales increased 5% this month and were driven by an increase of 7% in bike sales and a decrease of 2% in car sales.

    I am fine with identifying the increase/decrease using isnumber(search), but am struggling to find a way to have excel report in the correct order.

    Hope this makes sense.

    Cheers,

    G
    Attached Files Attached Files

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Commentary and If statements

    In the attached I have changed the source figures to demonstrate that this is working.

    To determine Total increase/decrease please find in B4
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Then in C4
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    From there the simplest way I can think of is to use a row of helper cells as in E2:M2.

    In E2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    To resolve the "a"/"an" in F2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    In G2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    H2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    I2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    J2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    K2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    L2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    M2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Then in D5 a referencing series of concatenations nested in the commentary.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by FlameRetired; 05-21-2019 at 07:59 PM.
    Dave

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

    Re: Commentary and If statements

    Thanks for the response- this is fantastic!
    Just one other thing, it looks like some of the data is actually going to have negative numbers, which from what I can work out will not work with Min/Max.
    Can you suggest a solution or workaround for this?

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Commentary and If statements

    Not sure I am interpreting correctly.

    Please upload another sample in your next post that demonstrates what you describe along with desired output. (please don't edit/change the first one)

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

    Re: Commentary and If statements

    Hi Flameretired,
    I have added a new sample which hopefully highlights the issue.
    Thanks again!
    Attached Files Attached Files

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Commentary and If statements

    I am somewhat confused by the upload cell comments although the output string in the attached matches your expected string.

    The helpers:
    Formula in E2 remains the same.

    The rest must be array entered.
    If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.

    In F2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    In G2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    In H2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    In I2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    In J2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    In K2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    In L2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    In M2
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The final formula remains the same as before.
    Attached Files Attached Files

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

    Re: Commentary and If statements

    Thanks FlameRetired!
    Much appreciated

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Commentary and If statements

    You are welcome. Thanks for the feedback and marking your thread Solved.

+ 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. How would you add commentary to a pivot table?
    By Jamie100 in forum Excel General
    Replies: 1
    Last Post: 07-23-2017, 06:09 PM
  2. Drop down menu with commentary
    By kuzna26 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-02-2014, 06:04 AM
  3. Adding commentary to Excel Cells
    By davidingilbert in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-20-2012, 02:24 PM
  4. Mordred Banned Commentary
    By FortySixAndTwo in forum The Water Cooler
    Replies: 28
    Last Post: 08-31-2012, 03:09 AM
  5. Conditional Formatting based on cell's commentary
    By XL_novice_LX in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-07-2012, 04:29 PM
  6. [SOLVED] Can I use Excel to create a tutorial with an audio commentary?
    By barryross in forum Excel General
    Replies: 0
    Last Post: 07-12-2005, 06:05 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