+ Reply to Thread
Results 1 to 7 of 7

Creating a "spread" every time a dummy changes

  1. #1
    Registered User
    Join Date
    02-19-2021
    Location
    Bergen, Norway
    MS-Off Ver
    Microsoft 365
    Posts
    16

    Creating a "spread" every time a dummy changes

    Skjermbilde 2021-02-19 kl. 11.06.35.png

    Hi

    I would like to create a value for each time "type_id" changes between 0 and 1.
    I want this value to be created by, for instance, subtracting price in C2 by C3, and the next value to be created by
    subtracting C3 with C4.

    However, There are instances where 0 or 1 appears more than once in a row. In these cases i would for instance like the "newest"
    1 to create a value with the latest 0. An example of this is value created by C9 subtracted by C10, and then C9 subtracted by C11, and the C9 being subtracted by
    C12, before C12 being subtracted by C13.

    I have added a sample workbook with manually calculated desired results (Manual calculation of desired results)

    Hope I was clear! Any help with this would be appreciated
    Attached Files Attached Files
    Last edited by Excelnick96; 02-20-2021 at 07:28 AM. Reason: Clarify

  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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Creating values by subtraction IF another value changes

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook.
    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
    02-19-2021
    Location
    Bergen, Norway
    MS-Off Ver
    Microsoft 365
    Posts
    16

    Re: Creating values by subtraction IF another value changes

    Here is a sample workbook with desired outcome calculated manually
    Attached Files Attached Files

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

    Re: Creating a "spread" every time a dummy changes

    Try pasting the following formula into cell G2 and copying down to cell G29:
    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.

  5. #5
    Registered User
    Join Date
    02-19-2021
    Location
    Bergen, Norway
    MS-Off Ver
    Microsoft 365
    Posts
    16

    Re: Creating a "spread" every time a dummy changes

    Thank you very much, JeteMc I'm not entirely sure how the formula operates, but I'll manage.

  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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Creating a "spread" every time a dummy changes

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

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon 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 those who helped.

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

    Re: Creating a "spread" every time a dummy changes

    You're Welcome. Thank You for the feedback and for marking the thread as 'Solved'.
    Utilizing the Evaluate Formula feature on the Formulas tab may help with understanding what the formula is doing.
    I hope that you have a blessed day.

+ 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. Range Subtraction / Matrix Subtraction - Large data set
    By excelrabbit in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-20-2015, 07:07 AM
  2. [SOLVED] Variable Subtraction From Gross Values
    By jdeal in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-10-2015, 02:16 PM
  3. Replies: 0
    Last Post: 01-29-2014, 02:58 PM
  4. Sum of absolute values after the subtraction of digits in two columns
    By raymond7904 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-17-2013, 01:08 PM
  5. [SOLVED] Subtraction and Values
    By TrainGirl in forum Excel General
    Replies: 11
    Last Post: 09-23-2012, 03:50 PM
  6. subtraction formula, and do not wish to show result until all values are input
    By aanderson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-03-2012, 06:47 AM
  7. creating addition/subtraction wksht
    By lemoineer in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-22-2009, 05:36 AM

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