+ Reply to Thread
Results 1 to 4 of 4

Replace formula?

  1. #1
    Registered User
    Join Date
    04-14-2012
    Location
    saudi arabia
    MS-Off Ver
    Excel 2007
    Posts
    15

    Replace formula?

    Hi,

    On one cell I have this formula:

    ='Pasta March'!P17

    On the cell below it I manually write

    ='Pasta April'!P17

    I was wondering if there is a way to automate this process as I have to do this process for more than 100 cells?

  2. #2
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: Replace formula? not sure, need help please

    I suspect that what ever you are doing, there is an easier way. But automating what you are asking for is surely not it. What is it you are trying to do?

  3. #3
    Registered User
    Join Date
    04-10-2012
    Location
    Argentina
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Replace formula? not sure, need help please

    Yes. Write:

    If you have a table like (2 columns)
    A | B
    Month | Total
    Jan | ='PastaJan'!P17
    Feb | ='PastaFeb'!P17
    Mar | ='PastaMar'!P17
    Apr | ='PastaApr'!P17
    May | ='PastaMay'!P17

    Then write in B2
    =INDIRECT("Pasta" & A2 & "!P17")

    Where A2 is a Cell that contains the month written in words (like "Jan").
    This formula will retrieve the value of a reference written as a string. In this case the string will be "PastaJan!P17" so it will retrieve the value there.

    I reccomend that you get rid of the spaces in the sheet names, otherwise you must do a small twitch to that formula (not worth it). Also if it works reply back cause ther's also 1 more thing you should add to the formula for it to be really complete and reliable.

    EDIT: Also if you dont wanna write January, Febraury, but instead have dates in the cells, its possible to make this work. Just tell me or upload an example.
    Last edited by darokal; 04-14-2012 at 03:00 AM.

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Replace formula?

    You can use this formula without a helper column or table:

    =INDIRECT("'Pasta "&TEXT(DATE(2012,ROW(A3),1),"mmmm")&"'!P17")

    If you fill that formula down rows it will change from March to April, May, etc. (You can fill it upward up to two rows as well to get January and February.)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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