+ Reply to Thread
Results 1 to 13 of 13

Update entire row based on one cell value

  1. #1
    Registered User
    Join Date
    10-05-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    57

    Update entire row based on one cell value

    Hi,

    I need to poupulate all cells in a row based one perticular cell value. Example: The attached excel file has 2 sheets. On sheet 1, it has a data set table which will be updated everyday. On sheet 2, I need to update the table based on cell value"YES". If the cell value is "NO" it has to skip to next row which has "Yes" and populate sheet 2. Any help is greatly appreciated.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Update entire row based on one cell value

    Hi kammariarun

    What I understand is, if a line item on sheet 1 gets changed from "No" to "Yes" you'd like it added to sheet 2.

    However, if a line item on sheet 1 is changed from "Yes" to "No", what do you wish to happen? Should it be deleted from sheet 2?
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Update entire row based on one cell value

    See the formulas in the attached workbook.
    Attached Files Attached Files
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  4. #4
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Update entire row based on one cell value

    Good nigt.

    Try this...

    Look file...
    Att..
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-05-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    57

    Re: Update entire row based on one cell value

    Quote Originally Posted by jaslake View Post
    Hi kammariarun

    What I understand is, if a line item on sheet 1 gets changed from "No" to "Yes" you'd like it added to sheet 2.

    However, if a line item on sheet 1 is changed from "Yes" to "No", what do you wish to happen? Should it be deleted from sheet 2?
    Yes. if the value is no it should delete from the sheet 2. I need to display only yes values in sheet 2. Thanks

  6. #6
    Registered User
    Join Date
    10-05-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    57

    Re: Update entire row based on one cell value

    Quote Originally Posted by jaslake View Post
    Hi kammariarun

    What I understand is, if a line item on sheet 1 gets changed from "No" to "Yes" you'd like it added to sheet 2.

    However, if a line item on sheet 1 is changed from "Yes" to "No", what do you wish to happen? Should it be deleted from sheet 2?
    Thank you very much. The formula works best for the provided data set in sheet 1. What if I want to extend the data set. I mean, I will be entering the data everyday basis and I want excel to update the sheet2 data automatically based on sheet 1 input. Thank you very much for your help.

  7. #7
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Update entire row based on one cell value

    If you adjust the formulas in my attached sheet, you can put them down to any row and they will still display the correct data. Just put them down to row 1000 or some row you will never reach.

  8. #8
    Registered User
    Join Date
    10-05-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    57

    Re: Update entire row based on one cell value

    Quote Originally Posted by marreco View Post
    Good nigt.

    Try this...

    Look file...
    Att..
    Thank you very much. I have a very basic knowledge about VBA programming and Macros. I am having trouble in understanding the program and extend the data for larger set. Thanks for your help.

  9. #9
    Registered User
    Join Date
    10-05-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    57

    Re: Update entire row based on one cell value

    Quote Originally Posted by davegugg View Post
    If you adjust the formulas in my attached sheet, you can put them down to any row and they will still display the correct data. Just put them down to row 1000 or some row you will never reach.
    Thank you very much.

  10. #10
    Registered User
    Join Date
    10-05-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    57

    Re: Update entire row based on one cell value

    Quote Originally Posted by davegugg View Post
    If you adjust the formulas in my attached sheet, you can put them down to any row and they will still display the correct data. Just put them down to row 1000 or some row you will never reach.
    Can you please mention the use of "-4" in your formula. I am trying to setup your formula for a data where I have more than 15 columns. Thank you very much for your help.

    =IF(ISERROR(INDEX(Sheet1!$A$5:$E$16,SMALL(IF(Sheet1!$E$5:$E$16="Yes",ROW(Sheet1!$E$5:$E$16)-4),ROW($A2)-ROW($A$1)),3)),"",INDEX(Sheet1!$A$5:$E$16,SMALL(IF(Sheet1!$E$5:$E$16="Yes",ROW(Sheet1!$E$5:$E$16)-4),ROW($A2)-ROW($A$1)),3))

  11. #11
    Registered User
    Join Date
    10-05-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    57

    Re: Update entire row based on one cell value

    Quote Originally Posted by davegugg View Post
    If you adjust the formulas in my attached sheet, you can put them down to any row and they will still display the correct data. Just put them down to row 1000 or some row you will never reach.
    My actual data sheet is atatched. I need to populate the yellow shaded column in sheet2 from the orange shaded data from sheet 1 based on Column P value (Yes or No) in sheet 1.

    I know I am asking too much but any help is greately appreciated.

    Thanks
    Attached Files Attached Files

  12. #12
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: Update entire row based on one cell value

    You are running into a few different issues:
    1 When you have sheet names in your formulas, you need to put them in single quotes.
    2 The number you are subtracting is the difference between the row your data starts in and the row you want to return. In this case, you had 17 typed into your formula, but you want 8 because your data in the DPE Operating Data sheet starts on row 9.

    =IF(ISERROR(INDEX('DPE Operating Data'!$A$9:$P$100,SMALL(IF('DPE Operating Data'!$P$9:$P$100="Yes",ROW('DPE Operating Data'!$P$9:$P$100)-8),ROW($A2)-ROW($A$1)),1)),"",INDEX('DPE Operating Data'!$A$9:$P$100,SMALL(IF('DPE Operating Data'!$P$9:$P$100="Yes",ROW('DPE Operating Data'!$P$9:$P$100)-8),ROW($A2)-ROW($A$1)),1))

    This is an array formula and needs to be confirmed with Ctrl + Shift + Enter.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    10-05-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    57

    Re: Update entire row based on one cell value

    Quote Originally Posted by davegugg View Post
    You are running into a few different issues:
    1 When you have sheet names in your formulas, you need to put them in single quotes.
    2 The number you are subtracting is the difference between the row your data starts in and the row you want to return. In this case, you had 17 typed into your formula, but you want 8 because your data in the DPE Operating Data sheet starts on row 9.

    =IF(ISERROR(INDEX('DPE Operating Data'!$A$9:$P$100,SMALL(IF('DPE Operating Data'!$P$9:$P$100="Yes",ROW('DPE Operating Data'!$P$9:$P$100)-8),ROW($A2)-ROW($A$1)),1)),"",INDEX('DPE Operating Data'!$A$9:$P$100,SMALL(IF('DPE Operating Data'!$P$9:$P$100="Yes",ROW('DPE Operating Data'!$P$9:$P$100)-8),ROW($A2)-ROW($A$1)),1))

    This is an array formula and needs to be confirmed with Ctrl + Shift + Enter.
    Thank you very very much. You are awesome.

+ 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