+ Reply to Thread
Results 1 to 6 of 6

Formulas are incredibly long, there has to be a way to clean them up...

Hybrid View

  1. #1
    Registered User
    Join Date
    07-25-2010
    Location
    PA
    MS-Off Ver
    Excel 365
    Posts
    51

    Formulas are incredibly long, there has to be a way to clean them up...

    Hello All,

    I've included a small sample of a very large workbook I'm working on. The Taxable and Tax-Exempt tabs are essentially data dumps broken by brokerage and then into their respective tabs.

    On the 2024 analysis tab is where I'm trying to do all my work. Cell G4:G15 is looking at the month in column "F", and trying to give me a gain/loss breakdown by month looking in the taxable tab and pulling the relevant data from each brokerage. So for the first Brokerage in Taxable "BBAE" the formula on the analysis tab is looking at column "F" Sell Date, and column "H" Gain loss. As you can see the formula is absurd, and as I add more brokerages to the Taxable tab it gets longer and longer. I'm worried eventually I'm going to run into major problem. It's already difficult enough to manage.

    Cell J4:J15 is doing the same computations but in the Tax-Exempt tab.

    Am I going about this the right way or is there an easier way?

    Thank you all in advance!
    Attached Files Attached Files

  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 2406
    Posts
    44,662

    Re: Formulas are incredibly long, there has to be a way to clean them up...

    You long formulae are incomprehensible.

    As a start, I changed the formulae in O and P to look like this:

    =SUMPRODUCT(--(Taxable!$C$3:$EC$3="Gain/Loss")*Taxable!C4:EC4)

    Please MANUALLY check the two red cell results. These differed from the values that you showed. I suspect that I'm right and you're wrong... but I'll leave that to you.

    Then in BABY STEPS, you need to explain the monster formulae. Start with the one in G4.

    In simple terms, what the hell is it meant to do???
    Attached Files Attached Files
    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

  3. #3
    Registered User
    Join Date
    07-25-2010
    Location
    PA
    MS-Off Ver
    Excel 365
    Posts
    51

    Re: Formulas are incredibly long, there has to be a way to clean them up...

    Quote Originally Posted by Glenn Kennedy View Post
    You long formulae are incomprehensible.

    As a start, I changed the formulae in O and P to look like this:

    =SUMPRODUCT(--(Taxable!$C$3:$EC$3="Gain/Loss")*Taxable!C4:EC4)

    Please MANUALLY check the two red cell results. These differed from the values that you showed. I suspect that I'm right and you're wrong... but I'll leave that to you.

    Then in BABY STEPS, you need to explain the monster formulae. Start with the one in G4.

    In simple terms, what the hell is it meant to do???
    You are correct, your values in Column P are capturing a broker I was missing. Thank you.

  4. #4
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    3,266

    Re: Formulas are incredibly long, there has to be a way to clean them up...

    Try this in cell G4 and copy down:

    =SUM((FILTER(Taxable!$4:$10000,Taxable!$3:$3="Gain/Loss"))*(MONTH(FILTER(Taxable!$4:$10000,Taxable!$3:$3="Sell Date"))=$E4))

    This give you the whole row to use for Broker expansion, and goes down 10,000 rows. You can adjust the ranges if you'd like. Say instead of the whole row, you wanted to go out to column FZ. You would use this:
    =SUM((FILTER(Taxable!$A$4:$FZ$10000,Taxable!$A$3:$FZ$3="Gain/Loss"))*(MONTH(FILTER(Taxable!$A$4:$FZ$10000,Taxable!$A$3:$FZ$3="Sell Date"))=$E4))
    Last edited by Gregb11; 05-18-2024 at 10:52 AM.

  5. #5
    Registered User
    Join Date
    07-25-2010
    Location
    PA
    MS-Off Ver
    Excel 365
    Posts
    51

    Re: Formulas are incredibly long, there has to be a way to clean them up...

    Quote Originally Posted by Gregb11 View Post
    Try this in cell G4 and copy down:

    =SUM((FILTER(Taxable!$4:$10000,Taxable!$3:$3="Gain/Loss"))*(MONTH(FILTER(Taxable!$4:$10000,Taxable!$3:$3="Sell Date"))=$E4))

    This give you the whole row to use for Broker expansion, and goes down 10,000 rows. You can adjust the ranges if you'd like. Say instead of the whole row, you wanted to go out to column FZ. You would use this:
    =SUM((FILTER(Taxable!$A$4:$FZ$10000,Taxable!$A$3:$FZ$3="Gain/Loss"))*(MONTH(FILTER(Taxable!$A$4:$FZ$10000,Taxable!$A$3:$FZ$3="Sell Date"))=$E4))
    OMG, this is incredible!! Thank you so much, this is so clean, and your values tie exactly to mine!

  6. #6
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    3,266

    Re: Formulas are incredibly long, there has to be a way to clean them up...

    You're welcome and thanks for the rep.

+ 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. Long formulas to breakdown R1C1 style formulas in vba
    By Dahlia in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-25-2017, 11:50 AM
  2. [SOLVED] =IF and =SUMIF formulas creating long long long data processing times.
    By comp in forum Excel Programming / VBA / Macros
    Replies: 32
    Last Post: 03-26-2014, 02:59 PM
  3. Simple and Probably Incredibly Dumb...
    By KCKuhns92 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-01-2013, 05:38 AM
  4. Spreasheet is incredibly slow
    By par0016 in forum Excel General
    Replies: 1
    Last Post: 02-24-2013, 11:07 AM
  5. [SOLVED] VBA Code to optimize and clean data- clean out numerical/ or symbol
    By tracylsr in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-05-2012, 04:21 PM
  6. Incredibly Cumbersome Code!
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 04-21-2008, 01:28 AM
  7. File Size incredibly big???
    By JC_VILLA789 in forum Excel General
    Replies: 1
    Last Post: 04-17-2008, 07:11 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