+ Reply to Thread
Results 1 to 8 of 8

Move contents of cells based on condition

Hybrid View

  1. #1
    Registered User
    Join Date
    09-13-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    2

    Question Move contents of cells based on condition

    I am new to excel and learning it. I have about 500 records in excel sheet containing year and names and race timings. These contents are filtered on year basis. I have placed the filtered records in second sheet. Now I want to move the contents of these filtered rows to another location based on name entered by user in a cell. the formula should copy all rows with the row containing name entered by user in a cell as the first row in the new list. Can anybody guide me with this ?

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Move contents of cells based on condition

    Hi and welcome to the forum.

    Be sure that best way to describe your problem is to upload a sample workbook.

    Be sure that all sensitive data removed, showing what data you are working with, a few examples of what your expected outcome is, and how you arrived at that.

    To attach a small sample workbook.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    09-13-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Move contents of cells based on condition

    I have attached a small excel file. Can you check it out ?
    Attached Files Attached Files

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Move contents of cells based on condition

    I use d2 different formulas.

    For the first name this one.

    Formula: copy to clipboard
    =INDEX(A$2:A$15;MATCH("*"&$D$2&"*";$A$2:$A$15;0))


    For ALL the others this ARRAY one.

    Formula: copy to clipboard
    =IFERROR(INDEX(A$2:A$15;SMALL(IF($A$2:$A$15<>$D$15;ROW(A$2:A$15)-1);ROW(A1)));"")


    Comments?

    -- Array(CSE) { }, formulae are confirmed with Control+Shift+Enter.
    Not just Enter.
    Attached Files Attached Files

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,941

    Re: Move contents of cells based on condition

    Mr Fortis why can't you use =IF(COUNTIF($D$15:$E15,A2)>0,A3,A2) instead of =IFERROR(INDEX(A$2:A$15;SMALL(IF($A$2:$A$15<>$D$15;ROW(A$2:A$15)-1);ROW(A1)));"")

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Move contents of cells based on condition

    Quote Originally Posted by nflsales View Post
    Mr Fortis why can't you use =IF(COUNTIF($D$15:$E15,A2)>0,A3,A2) instead of =IFERROR(INDEX(A$2:A$15;SMALL(IF($A$2:$A$15<>$D$15;ROW(A$2:A$15)-1);ROW(A1)));"")
    Did i say that we can not use this?

    No i didn't.

    Nice Thought! Just fix the result in F14..

    Also if the times are uniques we could use a simple INDEX & MATCH in F4 and copy down.

    Formula: copy to clipboard
    =INDEX($B$2:$B$13,MATCH(E4,$A$2:$A$13,0))

  7. #7
    Valued Forum Contributor
    Join Date
    09-15-2011
    Location
    Chennai, India
    MS-Off Ver
    Excel 2010
    Posts
    436

    Re: Move contents of cells based on condition

    Please try this file.
    Attached Files Attached Files
    Last edited by ramananhrm; 09-13-2013 at 06:12 AM.
    Please click 'Add reputation', if my answer helped you.

  8. #8
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,941

    Re: Move contents of cells based on condition

    see the attachement
    Attached Files Attached Files

+ 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. Move cell based on contents (VBA)
    By BaronDJB in forum Excel General
    Replies: 5
    Last Post: 12-21-2014, 11:24 AM
  2. [SOLVED] Move row from one sheet to another based on condition and then delete - please help
    By junijl in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-08-2013, 10:32 AM
  3. need to copy some cells contents to a another worksheet based on a value condition
    By Mochmoch in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-19-2013, 10:39 AM
  4. Replies: 0
    Last Post: 06-27-2012, 05:58 AM
  5. Move record from worksheet B to A based on a condition
    By Lifeseeker in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 12-27-2011, 12:48 AM

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