+ Reply to Thread
Results 1 to 8 of 8

summing a dynamical range with IF

  1. #1
    Forum Contributor
    Join Date
    10-26-2018
    Location
    Vienna, Austria
    MS-Off Ver
    2016 professional
    Posts
    148

    summing a dynamical range with IF

    Dear Professionals,


    I wrote a code to sum values of a column if some criterias are met but I can not make it dynamic.

    can you please help me? I also uploaded the file.

    i assume the red areas need to be different..


    Please Login or Register  to view this content.
    As it is one of my first codes I would appriciate if you could solve this with as little changes as possible that I will fully understand it
    I know it is totally not elegant way of doing but i am on a learning curve


    thank you indeed for your kind help!
    best regards
    Peter
    Attached Files Attached Files
    Last edited by peterschein; 04-26-2019 at 01:38 PM.

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: summing a dynamical range with IF

    How about
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    10-26-2018
    Location
    Vienna, Austria
    MS-Off Ver
    2016 professional
    Posts
    148

    Re: summing a dynamical range with IF

    thank you Fluff13 I will try to understand it but true dimming the sheets is a good idea!

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: summing a dynamical range with IF

    You're welcome & thanks for the feedback.
    For info on dictionaries have a look here https://excelmacromastery.com/vba-dictionary/

  5. #5
    Forum Contributor
    Join Date
    10-26-2018
    Location
    Vienna, Austria
    MS-Off Ver
    2016 professional
    Posts
    148

    Re: summing a dynamical range with IF

    thank you! on Sunday I will examine your code in depth have a nice weekend!

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: summing a dynamical range with IF

    And you
    Cheers

  7. #7
    Forum Contributor
    Join Date
    10-26-2018
    Location
    Vienna, Austria
    MS-Off Ver
    2016 professional
    Posts
    148

    Re: summing a dynamical range with IF

    Dear Fluff13


    one more question please.

    do I understand it correctly?


    it loops through the range and .Item(Cl.Value) works as a basket.
    it checks the content of the first cells value (3c60 in that case) and that is basket one..and then puts the offsetted cells value in basket 3c60.

    in the second loop it jumps one cell down and checks its value.. if its 3c60 again its value will be incremented with the offsetted cells value

    If it is not 3c60 but an other item it understands as a new basket and collects the new offsetted values to it and will be basket 2

    and so on ...


    My question is:


    in the other sheet ("artikel") the items must be in the same order as in sheet ("source").. is it right?

    because the code sorts like A2--> basket 1 value
    A3--> basket 2 value
    and so on...

    not taking into account if A2 is 3c60 or A3.

    Is that right? I am just not sure right now if the order of appearances will be always the same in both sheets...

    thank you for your answer!

    Peter

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: summing a dynamical range with IF

    You're understanding is correct, but the order of the values in either sheet does not matter.

+ 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. Making graphs using a defined dynamical array.
    By damp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-27-2015, 08:37 AM
  2. dynamical change of imported cells in a formula
    By Torrac in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-03-2015, 11:10 AM
  3. Manual data entry in dynamical table
    By gutkinma in forum Excel General
    Replies: 2
    Last Post: 12-08-2014, 09:00 AM
  4. Replies: 1
    Last Post: 01-01-2013, 01:58 PM
  5. Create chart from dynamical values
    By Kenny Bones in forum Excel General
    Replies: 0
    Last Post: 07-05-2011, 04:33 AM
  6. Create a Forecast table with dynamical period range
    By dreams in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-17-2009, 08:48 AM
  7. [SOLVED] How to create a chart based on a 2 dim data range dynamical in 1 d
    By Beertje in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 10-25-2005, 07: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