+ Reply to Thread
Results 1 to 7 of 7

Copy formula that spans several rows of data

  1. #1
    Registered User
    Join Date
    11-15-2012
    Location
    Anchorage, AK
    MS-Off Ver
    Excel 2013
    Posts
    22

    Copy formula that spans several rows of data

    Hi guys,

    I have been manually entering a nested IF statement row after row for some time now and decided to see if there is a better way to accomplish this. Attached is a screenshot of a portion of my raw data.

    Untitled.png

    What I want to do is extract the data collected for each sample to its own worksheet within this excel file. So my loop consists of "IF this sample is sample 1 then copy this cell, IF this sample is sample 2 then copy this cell, and so on." Attached is an image of what I want as an end result.

    Individual Sample.png

    The issue I am having is that my IF formula has to check 6 different rows for each time measurement. For example, at t=0.25 hrs my formula checks values in rows 9 through 14 and for t=0.50 hrs the formula checks values in rows 15 through 20. Whenever I try to copy my nested loop formula from one row to the next the values due not iterate the way I need them to. Is there a way to do this, or am I stuck typing away?

    Thanks!
    Attached Files Attached Files
    Last edited by acmichae; 11-07-2013 at 11:30 PM. Reason: Uploaded workbook

  2. #2
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,366

    Re: Copy formula that spans several rows of data

    Welcome to the forum.

    Can you post a real sample workbook so that members could offer solutions.
    Thank you for joining.
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  3. #3
    Registered User
    Join Date
    11-15-2012
    Location
    Anchorage, AK
    MS-Off Ver
    Excel 2013
    Posts
    22

    Re: Copy formula that spans several rows of data

    Thanks for the welcome vlady. I also just uploaded my workbook.

  4. #4
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Copy formula that spans several rows of data

    Try this.

    Please Login or Register  to view this content.
    And copy to right and down the cells.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  5. #5
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,366

    Re: Copy formula that spans several rows of data

    in column K .... sheet name -> "All Sample"
    you can change this formula

    =IF(C3=1,($O$4/$P$9)*J3, IF(C3=2,($O$4/$P$10)*J3, IF(C3=3,($O$4/$P$11)*J3, IF(C3=4,($O$4/$P$12)*J3, IF(C3=5,($O$4/$P$13)*J3, IF(C3=6,($O$4/$P$14)*J3))))))

    to this one.

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    11-15-2012
    Location
    Anchorage, AK
    MS-Off Ver
    Excel 2013
    Posts
    22

    Re: Copy formula that spans several rows of data

    sktneer,

    I entered the code you provided in my sheet for sample 1 and it worked fine. I duplicated the sheet for my sample 2 and changed the sample number from 1 to 2 at the top of the worksheet. In this new data page the formula does not work for all of my data points. I have looked through the evaluation steps but I cannot seem to find the problem. I have attached my updated Excel file.
    Attached Files Attached Files

  7. #7
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Copy formula that spans several rows of data

    Yes you are right. The formula is incorrect. In fact it is not even correct for the value 1 in cell E1.
    The formula is returning the wrong value in both the cases. I am sorry that I didn't check it.
    But don't worry, this forum is full of experts and someone would definitely come up with a solution to your query.
    Hope you will get the desired formula.

+ 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. How to get monthly kWh usage when bill data spans months?
    By robertandrews in forum Excel General
    Replies: 3
    Last Post: 06-08-2013, 09:55 AM
  2. Insert new rows, copy formula and clear data
    By juskojj in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-26-2012, 08:09 AM
  3. Replies: 15
    Last Post: 10-27-2011, 08:21 AM
  4. Replies: 6
    Last Post: 05-01-2010, 04:37 AM
  5. [SOLVED] Macro to copy formula to all rows that contain data in columns A:C
    By jasonthedce@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2006, 10:45 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