+ Reply to Thread
Results 1 to 3 of 3

Inserting rows and performing calculations

  1. #1
    Registered User
    Join Date
    11-22-2019
    Location
    Tennessee, United States
    MS-Off Ver
    16.31
    Posts
    2

    Talking Inserting rows and performing calculations

    Hello everyone! New here. Hoping someone can help save me to design a macro, use a script, SOMETHING!

    I have a cancer dataset from all countries globally from 1990 to 2017 displaying 1 variable, prevalence. The data is displayed as follows:

    Code Entity Year Prevalence
    AFG Afghanistan 1990 37368.73147
    AFG Afghanistan 1991 37785.11432
    ...
    AFG Afghanistan 2017 87681.28407
    ALB Albania 1990 19960.99434
    ALB Albania 1991 20607.36016

    Here's what needs to happen. For every country (231 values), I need to project the prevalence rate out to 2030 using the average annual growth rate from 1990 to 2017.

    What is my best strategy to:
    Insert 13 rows after each occurance of "2017" in the year column
    Fill these rows with the years 2018-2030
    Take an average of the annual growth rate for each country
    Use this rate to project a prevalence for each country for the years 2018-2030

    I have ~some~ experience with Macros and this seems like a problem that a Macro can solve. I just don't quite know how!
    Anything helps. Thanks!
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    02-04-2010
    Location
    Hertfordshire, England
    MS-Off Ver
    Office 2007 (home) Office 365 (work)
    Posts
    134

    Re: Inserting rows and performing calculations

    Hi

    You can try the code below, you need to run it from the dataset sheet.

    Please Login or Register  to view this content.
    Last edited by excelxx; 11-25-2019 at 04:13 PM.

  3. #3
    Registered User
    Join Date
    11-22-2019
    Location
    Tennessee, United States
    MS-Off Ver
    16.31
    Posts
    2

    Re: Inserting rows and performing calculations

    Woah. Brilliant! Thank you so much!

+ 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] VBA Code inserting rows and doing calculations where it shouldn't.
    By rjw524 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-02-2015, 03:25 PM
  2. Performing Calculations on Array Data
    By joeymountain in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-17-2014, 02:20 PM
  3. Performing multiple calculations
    By halsall555 in forum Excel General
    Replies: 1
    Last Post: 10-13-2013, 12:08 PM
  4. populating the cells by performing calculations.
    By expert40 in forum Excel General
    Replies: 1
    Last Post: 02-18-2012, 07:48 AM
  5. Excel 2007 : Performing calculations in cells
    By morris_k in forum Excel General
    Replies: 2
    Last Post: 01-28-2012, 12:37 PM
  6. Performing calculations on arrays...
    By a303 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-25-2007, 12:40 AM
  7. Ignoring #DIV/0! Errors when Performing Calculations
    By ExcelTip in forum Tips and Tutorials
    Replies: 0
    Last Post: 08-25-2005, 03:42 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