+ Reply to Thread
Results 1 to 2 of 2

Rearranging A column in Excel

  1. #1
    Registered User
    Join Date
    01-19-2021
    Location
    Karachi, Pakistan
    MS-Off Ver
    Office 16
    Posts
    52

    Rearranging A column in Excel

    Hello,

    I am stuck at a problem for awhile. I will highly appreciate if someone can help me out with this.

    I have a column with "Buy" and "Sell" Signals (three variables, that is, "Buy, "Sell", or ""). However, Buy signals appear multiple times before a sell signal, and sell signal appears multiple times before a buy signal. I want to rearrange the column such that
    1) the first signal that I receive in my column is a buy signal, that is, ignore all cells (Let them remain empty) that read "Sell" before the first buy
    2) After the first buy signal appears, ignore all the buy signals before a sell signal appears.
    3) When a sell signal appears, ignore all the cells until the next buy signal appears
    4) Repeat such that every buy signal is followed by an empty cell until a sell signal appears, and subsequently, every sell signal is followed by an empty cell until a buy signal appears.

    I would highly appreciate if someone can help me with this.

    Also, I have attached a sample file in which I show that I want Column A to look like Column B.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    01-09-2014
    Location
    Leeds, England
    MS-Off Ver
    Excel 365
    Posts
    72

    Re: Rearranging A column in Excel

    I've added a helper column in column C, which indicates either 1 or 0 depending on whether most recent signal was Buy or Sell.

    Then in column D I have added either Buy or Sell when the indicator changes.
    Attached Files Attached Files

+ 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] rearranging column data with repeat instances and blank cells
    By rkong in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-06-2019, 09:48 PM
  2. [SOLVED] Help Rearranging a Formula in ExCel
    By Metcalfe in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-01-2018, 03:44 AM
  3. Rearranging Data in A column
    By zyzzyva57 in forum Excel General
    Replies: 4
    Last Post: 02-10-2017, 05:54 AM
  4. Rearranging column order using formulas
    By dchubbock in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-08-2015, 08:06 PM
  5. Replies: 3
    Last Post: 04-04-2012, 10:47 AM
  6. Rearranging tables into six-column format
    By The_YongGrand in forum Excel - New Users/Basics
    Replies: 10
    Last Post: 11-24-2009, 10:05 AM
  7. rearranging cells in a column
    By kras in forum Excel General
    Replies: 2
    Last Post: 11-13-2008, 04: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