+ Reply to Thread
Results 1 to 8 of 8

Copy and past from different sheets based on different criteria then sum certain columns

  1. #1
    Forum Contributor
    Join Date
    03-14-2015
    Location
    Mexico
    MS-Off Ver
    365
    Posts
    279

    Copy and past from different sheets based on different criteria then sum certain columns

    Hi people, I am a totally new on this, my basic knowledges do not help me much on what I am trying to achieve. Hopefully I can find an answer here.

    Description on what I am trying to archive is on sheet2.

    Thank you
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Copy and past from different sheets based on different criteria then sum certain colum

    I'm having a difficult time understanding the description in your file, but based on your expected results, I put the following formula in D2, then filled down:

    =IF(IFERROR(VLOOKUP(A2,Sheet3!$A$2:$D$25,4,FALSE)-SUMIF($A$1:$A1,$A2,$D$1:$D1),0)>0,MIN(C2,VLOOKUP(A2,Sheet3!$A$2:$D$25,4,FALSE)-SUMIF($A$1:$A1,$A2,$D$1:$D1)),"")

    And in E2 and down:

    =IF(D2="",C2,C2-D2)

    Take a look at the attachment to see if I'm on the right track. If I'm not, please try to provide a clear explanation of what is missing and a few more expected results.
    Attached Files Attached Files
    If your problem has been solved, please use "Thread Tools" to mark the thread as "Solved".

    If you're grateful for this site's existence and would like to contribute to the community, please consider posting something hilarious in our joke thread:
    https://www.excelforum.com/the-water...ke-thread.html

  3. #3
    Forum Contributor
    Join Date
    03-14-2015
    Location
    Mexico
    MS-Off Ver
    365
    Posts
    279

    Re: Copy and past from different sheets based on different criteria then sum certain colum

    Hi CAntosh,

    Sorry that i did not explain well. I tried to do something different and did attach my file. Hopefully we can get an answer.

    Thanks for your help.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Copy and past from different sheets based on different criteria then sum certain colum

    I believe the formulas I provided in post #2 provide the results you're looking for. I've applied them to the attachment in post #3 and they seem to fit what you're describing. Can you please look at the attachment and explain exactly what it is doing incorrectly?
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    03-14-2015
    Location
    Mexico
    MS-Off Ver
    365
    Posts
    279

    Re: Copy and past from different sheets based on different criteria then sum certain colum

    For some reason I messed up with the formula, it dit work well, thank you so much.

    One last question, is there any idea as to put an alert, highlight on red or do something in Column D from sheet2 when a requested quantity from sheet2 cannot be covered by sheet2 column D?

    Attach in red what I am taking about.

    Thanks again.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Copy and past from different sheets based on different criteria then sum certain colum

    If I'm understanding correctly, then select A2:E23, select conditional formatting --> new rule --> use a formula, then use the following formula:

    =VLOOKUP($A2,Sheet3!$A$2:$D$7,4,FALSE)>SUMIF($A$1:$A1,$A2,$D$1:$D1)+SUMIF($A2:$A$23,$A2,$C2:$C$23)

    I'm not sure whether you just want to highlight just the zero-quantity rows that qualify or all rows with the item# that qualifies. The formula above will do the latter. Hopefully that's what you're looking for? Experiment with the attachment to see if it works as desired:


    EDIT: You can delete column F in the attachment, it's just a test column indicating which rows (those marked TRUE) will trigger the formatting.
    Attached Files Attached Files
    Last edited by CAntosh; 09-20-2017 at 11:25 AM.

  7. #7
    Forum Contributor
    Join Date
    03-14-2015
    Location
    Mexico
    MS-Off Ver
    365
    Posts
    279

    Re: Copy and past from different sheets based on different criteria then sum certain colum

    Thank you so much CAntosh, works handsomely!

  8. #8
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Copy and past from different sheets based on different criteria then sum certain colum

    Excellent, glad to help! Good luck!

+ 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] Copy and past columns in another sheet if column has certain “ Heading Criteria”
    By hudson andrew in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-04-2016, 07:14 AM
  2. [SOLVED] Copy Past cut rows based on conditions to different sheets
    By moonbreakker in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-29-2015, 08:55 AM
  3. Copy rows from two sheets to another based on criteria
    By ANDREAAS in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 06-09-2014, 09:48 AM
  4. Copy and Past Entire Row based off of Criteria into new Worksheet
    By KLiving in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-25-2013, 09:51 AM
  5. [SOLVED] Copy/Paste multiple columns as values based on another columns criteria
    By Dgp2012 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-28-2013, 06:50 AM
  6. copy and past to different sheets based on criteria
    By rz6657 in forum Excel General
    Replies: 4
    Last Post: 10-05-2010, 11:56 AM
  7. copy certain cells to 1 of 2 sheets, criteria based
    By ramseyprescott in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-16-2010, 01:11 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