+ Reply to Thread
Results 1 to 2 of 2

Is it possible to find the highest product of a serie of n adjacent cells within a column

  1. #1
    Registered User
    Join Date
    03-10-2021
    Location
    Europe
    MS-Off Ver
    office 2019
    Posts
    1

    Question Is it possible to find the highest product of a serie of n adjacent cells within a column

    Hi everyone,

    I am looking for a formula that could find the highest possible product of a serie of n adjacent cells/values within a column.

    Example :
    A1: 2
    A2: 1,5
    A3: 0,5
    A4: 3
    A5: 0.8
    Etc … A250: 1.4

    How to look for the highest possible product of 4 successive values, ( ex: A132*A133*A134*A135 ) ?


    Would it be it for instance, possible to find the highest product of 4 successive cells among this column ?

    Not the 4 highest individual cells/values but the highest product (or sum) of 4 contiguous cells/values ?


    Any help would be appreciated.



    Thanks for your attention



    Edit : in the same vein, is there a forumula or a way, to find the contiguous sequence ( without a specified number of cells) with the largest product in a column ?
    Attached Files Attached Files
    Last edited by logme; 03-10-2021 at 04:59 PM. Reason: rephrasing

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,850

    Re: Is it possible to find the highest product of a serie of n adjacent cells within a col

    Short but useless answer -- yes this is possible. Here's how I set it up:

    1) A product of contiguous cells is easily calculated using the PRODUCT() function. PRODUCT(C3:C6) for example.
    2) To get a variable size range, use the OFFSET() function OFFSET(C3,0,0,$I$3,1) returns a range that begins 0 rows below and 0 rows to the right of C3 with a height specified in I3 and a width of 1. If I3 contains the number 4, this is equivalent to C3:C6.
    3) combine the two =PRODUCT(OFFSET(C3,0,0,$I$3,1)) and copy down as far as needed. Note the mix of relative and absolute references for easy copying. I chose to put this formula in F3 and copy down.
    4) To find the maximum value, simply use the MAX() function. =MAX(F3:F228). I chose J9 for this function.

    At this point, I can enter any value between 1 and 226 into I9 and get the maximum value of contiguous products in the data set.

    In order to find which value in I9 results in the largest maximum, I made a data table (https://www.excel-easy.com/examples/data-tables.html ).
    5) Enter the desired values for I9 in I10 and down (226 in I10, 225 in I11, and so on, or use a formula like =I10-1 in I11 and copy down).
    6) Select I9:J100 (or however far down you want the data table to extend) -> Data -> What if analysis -> Data table -> I9 as column input cell. Column J should fill in with the appropriate values for each value of n in column I.
    7) Use the MAX() function again on column J to find the maximum value.

    Will something like that work for you?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ 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] i want to find the product with the highest number
    By Sephre in forum Excel General
    Replies: 8
    Last Post: 12-24-2020, 05:53 PM
  2. Replies: 5
    Last Post: 02-14-2019, 02:20 PM
  3. Replies: 6
    Last Post: 01-09-2019, 05:33 AM
  4. [SOLVED] Find 0's down a column and replace the Average of adjacent cells
    By sdingman in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-12-2017, 03:41 PM
  5. Find cells containing text, but group them at top of adjacent column
    By stanbridge in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-03-2016, 08:36 PM
  6. Replies: 7
    Last Post: 05-28-2014, 03:19 AM
  7. Replies: 2
    Last Post: 10-26-2009, 06:43 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