+ Reply to Thread
Results 1 to 13 of 13

Transfer data from one sheet to another based on value

  1. #1
    Registered User
    Join Date
    05-12-2015
    Location
    USA
    MS-Off Ver
    2013
    Posts
    25

    Transfer data from one sheet to another based on value

    excel.jpg

    OK...what we need to do is take data from sheet 1 to another sheet in the same workbook. We want to pull ONLY the code/amounts for the ones that have a balance over $0 (shown as a "-" in the cell). We tried VLOOKUP but that will pull over all codes...I am thinking INDEX/MATCH but not real sure how to pull it off.

    Any help is greatly appreciated!

  2. #2
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Transfer data from one sheet to another based on value

    index(range.code,match(1;(range.amount>0)*(counif($H$1:H1,range.code)=0),)) as CSE
    $H$1:H1 is here for example

  3. #3
    Registered User
    Join Date
    05-12-2015
    Location
    USA
    MS-Off Ver
    2013
    Posts
    25

    Re: Transfer data from one sheet to another based on value

    Is "range" in your example a fill in for whatever I call the data on sheet 1?

    Also...$H$1:H1 is the column on sheet 2 that the data will transfer to?

    I apologize for the dumb questions...I have a basic knowledge of excel and this is over my head a little!

  4. #4
    Valued Forum Contributor Sadath31's Avatar
    Join Date
    03-02-2011
    Location
    Dammam, Saudi Arabia
    MS-Off Ver
    Office 365
    Posts
    452

    Re: Transfer data from one sheet to another based on value

    Hi

    pls find the attachment..
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    10-28-2015
    Location
    Lincolnshire, England
    MS-Off Ver
    2016
    Posts
    188

    Re: Transfer data from one sheet to another based on value

    This works and is more simple.

    on sheet 1, change the amount to just 0 (where you has "-")
    on sheet 2, use this code in cell A1

    =IF(Sheet1!B1=0,,Sheet1!A1)

    Then drag the fill handle down...

    Hope this helps

  6. #6
    Registered User
    Join Date
    05-12-2015
    Location
    USA
    MS-Off Ver
    2013
    Posts
    25

    Re: Transfer data from one sheet to another based on value

    How do I modify the formula on sheet 2 to make this work? I am sure that I have to add a sheet or range name somewhere.

    This is in reply to Sadath31
    Last edited by rr23724; 11-04-2015 at 11:08 AM.

  7. #7
    Registered User
    Join Date
    05-12-2015
    Location
    USA
    MS-Off Ver
    2013
    Posts
    25

    Re: Transfer data from one sheet to another based on value

    Quote Originally Posted by LukeGilfoyle View Post
    This works and is more simple.

    on sheet 1, change the amount to just 0 (where you has "-")
    on sheet 2, use this code in cell A1

    =IF(Sheet1!B1=0,,Sheet1!A1)

    Then drag the fill handle down...

    Hope this helps
    This returns a bunch of "0" values...we need to display ONLY they ones that have a balance.

  8. #8
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Transfer data from one sheet to another based on value

    Here is an ARRAY formula that doesn't use helper columns. Copy the headings from Sheet1 to Sheet2 (A1 and B1) and enter this formula in A2 and fill across and down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

    A
    B
    1
    Code Amount
    2
    2345
    500
    3
    3456
    600
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  9. #9
    Registered User
    Join Date
    05-12-2015
    Location
    USA
    MS-Off Ver
    2013
    Posts
    25

    Re: Transfer data from one sheet to another based on value

    Quote Originally Posted by Sadath31 View Post
    Hi

    pls find the attachment..
    How do I modify the formula on sheet 2 to make this work? I am sure that I have to add a sheet or range name somewhere.

  10. #10
    Forum Contributor
    Join Date
    10-28-2015
    Location
    Lincolnshire, England
    MS-Off Ver
    2016
    Posts
    188

    Re: Transfer data from one sheet to another based on value

    Quote Originally Posted by rr23724 View Post
    This returns a bunch of "0" values...we need to display ONLY they ones that have a balance.
    No Problem. Use this then.

    =IF(Sheet1!B1=0,"",Sheet1!A1)


    ---- And if you don't want any gaps between your codes then place the my code suggestion in sheet 2 cell "a2".
    Then press the letter "A" (just above cell A1)..
    then go to the 'data' tab and then press 'Filter'

    You will see a small button appear in cell a1.
    press it.
    then press "blanks" to remove the tick.

    This will then sort the colum just to show your codes without any gaps.

    Hope this helps?
    Last edited by LukeGilfoyle; 11-04-2015 at 11:41 AM. Reason: Improvement

  11. #11
    Registered User
    Join Date
    05-12-2015
    Location
    USA
    MS-Off Ver
    2013
    Posts
    25

    Re: Transfer data from one sheet to another based on value

    Quote Originally Posted by newdoverman View Post
    Here is an ARRAY formula that doesn't use helper columns. Copy the headings from Sheet1 to Sheet2 (A1 and B1) and enter this formula in A2 and fill across and down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

    A
    B
    1
    Code Amount
    2
    2345
    500
    3
    3456
    600
    This works exactly as I need except when I try to paste across it forces me to go over at least 5 columns and creates cells that I do not need. Is there any way to change that or do I just have to manually delete those extra columns of data.

    Never mind...I figured it out.

    I think this is my answer...thank you!
    Last edited by rr23724; 11-04-2015 at 11:55 AM.

  12. #12
    Registered User
    Join Date
    05-12-2015
    Location
    USA
    MS-Off Ver
    2013
    Posts
    25

    Re: Transfer data from one sheet to another based on value

    Quote Originally Posted by LukeGilfoyle View Post
    No Problem. Use this then.

    =IF(Sheet1!B1=0,"",Sheet1!A1)


    ---- And if you don't want any gaps between your codes then place the my code suggestion in sheet 2 cell "a2".
    Then press the letter "A" (just above cell A1)..
    then go to the 'data' tab and then press 'Filter'

    You will see a small button appear in cell a1.
    press it.
    then press "blanks" to remove the tick.

    This will then sort the colum just to show your codes without any gaps.

    Hope this helps?
    That works but we are trying to make something that users do not have to do anything manually on sheet 2...people have routinely messed up anything that has filters or sorts.

  13. #13
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Transfer data from one sheet to another based on value

    For the first time using the formula, if the results are always going to be in the same place enter the formula as given then delete the columns not required. You can now copy those formulae and paste into a new worksheet.

    A
    B
    C
    D
    E
    F
    1
    Code Amount
    2
    2345
    500
    3
    3456
    600

+ 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] Transfer data based on the names of the sheet
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-09-2016, 01:28 AM
  2. Transfer data from Master sheet to another sheet based on value.
    By TylerLuk1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-12-2015, 12:00 PM
  3. VBA Code for transfer of data to a new exce sheet based on condition
    By deva123 in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 10-12-2014, 08:07 AM
  4. Collect Data into Array and Transfer from One Sheet to Another based on variable
    By fiasco in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-25-2014, 02:43 PM
  5. [SOLVED] VBA code to automatically transfer data from one sheet to another based on dropdown
    By jadersantos in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-22-2013, 11:01 AM
  6. Transfer Data To Different Sheet Based on Condition
    By Strugggler in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-27-2008, 08:42 PM
  7. Use button on sheet to transfer data based on todays date
    By Qaspec in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-25-2005, 01:37 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