+ Reply to Thread
Results 1 to 2 of 2

Apply a Excel Labs formula that skips the first number in an array it is applied to.

  1. #1
    Registered User
    Join Date
    04-23-2023
    Location
    Norway
    MS-Off Ver
    365
    Posts
    1

    Arrow Apply a Excel Labs formula that skips the first number in an array it is applied to.

    NB! The formula shown "ANN_INFL" is supposed to say "... ROW()-2", not "... ROW()-1".

    Hi everyone, I am trying to apply my formula to an array of numbers using MAP and LAMBDA, but I want the formula to start at the second number and not the first. When I MAP the array, x will always start at the first number, but I need x to start at the second number in the array. Some context:

    This is my data and my formula:

    ss1.png
    ss2.png


    From the data I have made the formula "AVG_CPI" to aggregate the CPI numbers from column B into yearly averages such that I have an annual CPI from 1985 to 2023.
    In column D is what it prints out.

    The formula "ANN_INFL" MAPs the annual CPI numbers (as demonstrated displayed in column D) and calculates the inflation.

    The problem is that when it is applied to the first number (44.23), it subtracts by the INDEX(array, ROW(x)-2) which will subtract by the cell above 44.23 and for some reason print out an dynamic array of all the numbers, so when looping through with the first value being a #SPILL! error, the entire array becomes errors.

    How can I adjust the function "ANN_INFL" such that it skips the first number and x is actually the second number?

    Thank you for help

    File is uploaded as well.
    Attached Files Attached Files
    Last edited by alphonso22; 04-23-2023 at 12:11 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: Apply a Excel Labs formula that skips the first number in an array it is applied to.

    Try: AVG_CPI
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by TMS; 04-27-2023 at 08:43 PM.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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. Replies: 8
    Last Post: 04-26-2019, 06:53 AM
  2. Create a new array that skips row
    By kzh11411 in forum Excel General
    Replies: 3
    Last Post: 05-10-2017, 08:57 AM
  3. Calling up Titus Labs Message Classification from Excel
    By Bilby in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-17-2014, 12:53 AM
  4. Need to apply a Vlookup formula from VBA to excel in an array
    By jmacinnees in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-04-2014, 01:35 AM
  5. Replies: 4
    Last Post: 07-22-2014, 06:05 PM
  6. [SOLVED] Apply 'X only to records that has Filters applied
    By nironto in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-09-2013, 07:07 AM
  7. Downloading Finished Excel Labs Online?
    By crashxdjp in forum Excel General
    Replies: 0
    Last Post: 11-21-2005, 01:12 PM

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