+ Reply to Thread
Results 1 to 12 of 12

Max function Based on previous entries criteria pattern till current row

  1. #1
    Forum Contributor
    Join Date
    07-10-2019
    Location
    england
    MS-Off Ver
    2013
    Posts
    486

    Max function Based on previous entries criteria pattern till current row

    Hi,
    I want to use max function for variable range.
    Starting row will be based on pattern in Col A and ending row will be current row..
    I have used max if with not correct result and also indirect function for row reference.. i am going wrong..
    want a macro or formula..
    attaching file yellow is the result needed
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    01-14-2013
    Location
    Austria
    MS-Off Ver
    2016 / 2019
    Posts
    339

    Re: Max function Based on previous entries criteria pattern till current row

    see attachment. is it what you need?
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    07-10-2019
    Location
    england
    MS-Off Ver
    2013
    Posts
    486

    Re: Max function Based on previous entries criteria pattern till current row

    Hi gue,
    Your solution is eventhough has the same result..
    But what i want is the first column is the pattern.. for each pattern i am checking non zero minimum value, so that is maximum formula from starting row of the pattern( here the pattern is 1-2-3-4),
    So starting row of 1 till the current row , max function..
    In that process, i am finding minumum non zero value for that pattern greater than a variable in H1 , which i have not provided...lets say 1..

    So , i am trying to find max values for that particular pattern range..
    Then i will check whether it is greater than variable or not..
    If it is greater , i will have the number else it will be blank.
    Finally for each pattern i will have a value as summary..

    This is what i am trying to achieve.

  4. #4
    Forum Contributor
    Join Date
    07-10-2019
    Location
    england
    MS-Off Ver
    2013
    Posts
    486

    Re: Max function Based on previous entries criteria pattern till current row

    For pattern 1 the max function should have for current row 5
    max(b1:b5)
    for pattern 2 current row 10
    max(b6:b10)

  5. #5
    Forum Contributor
    Join Date
    07-10-2019
    Location
    england
    MS-Off Ver
    2013
    Posts
    486

    Re: Max function Based on previous entries criteria pattern till current row

    I am having around 80000 rows, so am trying for macro..
    But essentially it is a max if with starting row and current row is variable range..
    So formula is also appreciated..

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,336

    Re: Max function Based on previous entries criteria pattern till current row

    So...Are you wanting max value for range based on active cell ...
    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  7. #7
    Forum Contributor
    Join Date
    07-10-2019
    Location
    england
    MS-Off Ver
    2013
    Posts
    486

    Re: Max function Based on previous entries criteria pattern till current row

    yes.. but the starting row for the range must be based on col A pattern (1-2-3-4)..
    Till the active cell..
    Will check your code..

  8. #8
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,336

    Re: Max function Based on previous entries criteria pattern till current row

    Perhaps you should explain step for step what you are wanting to achieve...

  9. #9
    Forum Contributor
    Join Date
    07-10-2019
    Location
    england
    MS-Off Ver
    2013
    Posts
    486

    Re: Max function Based on previous entries criteria pattern till current row

    Hi,
    No your code doesnt produce desired result.. not based on active cell..
    max range or max if range starting and ending range- starting - based on col a pattern starting row.. ending range is current row
    i did like this
    =+MAX("Q"&N3&","&"Q"&Q21&"")
    or
    /{=MAX(IF("B"&N5&":"&"B"&N5&""=B5,"h"&Q5&":"&"h"&Q5&""))}
    But it is either showing #value error or 0..

  10. #10
    Forum Contributor
    Join Date
    07-10-2019
    Location
    england
    MS-Off Ver
    2013
    Posts
    486

    Re: Max function Based on previous entries criteria pattern till current row

    Hi Sintex,
    COl A is the pattern.. if you see 1-1-1-1,2-2-2-2
    so it changes after a series of repeating value..

    I want to summarize value for each pattern..
    Condition non zero values
    >5
    minimum value among the pattern group..

    So lets say.. for pattern 2.. the answer would be 6..
    it is non zero, greater than 5 and minimum value among that group..

    so for 2 it would be 6
    for 1 there is none
    3 also 6
    4 it is 8

    This is what i am trying to summarize

  11. #11
    Forum Contributor
    Join Date
    07-10-2019
    Location
    england
    MS-Off Ver
    2013
    Posts
    486

    Re: Max function Based on previous entries criteria pattern till current row

    The said pattern is no of days.. so for each day i am logging values and trying to summarize not based on sum.. but based on minimum of that day provided it is greater than the condition (> somevalue in the example it is 5)

    And i have too many rows approx 80K so it would be difficult for me to change the range for each.. so formula or macro i need...

    Macro would be prefered as my above formula is giving me #value and due of no of rows..

  12. #12
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,336

    Re: Max function Based on previous entries criteria pattern till current row

    Sorry explanation i do not understand...
    if this is not as per my understanding then perhaps someone else can assist...
    Result is based on max of range to activecell...
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by sintek; 04-15-2020 at 05:16 AM.

+ 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] Formula for autocalculating difference based on current and previous day
    By Slightly in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-19-2019, 01:05 AM
  2. [SOLVED] Finding the most current and previous current date based on multiple criteria
    By tkbuc in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-27-2016, 06:06 PM
  3. SUM IF FORMULA BASED ON CURRENT/PREVIOUS/NEXT Month
    By AK123 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-21-2016, 01:10 PM
  4. Average of previous 6 entries with 2 criteria using date.
    By ayrmad in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-24-2013, 07:47 PM
  5. Average function to count till current month !!!
    By sonu1975 in forum Excel General
    Replies: 5
    Last Post: 05-11-2012, 07:44 AM
  6. Replies: 4
    Last Post: 03-21-2011, 05:37 PM
  7. using data till till the current row
    By nilu8603 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-26-2010, 04:30 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