+ Reply to Thread
Results 1 to 11 of 11

cut and paste calculation

  1. #1
    Registered User
    Join Date
    07-11-2012
    Location
    Canada
    MS-Off Ver
    Mac 2010
    Posts
    5

    cut and paste calculation

    Hey everyone, i'm new to the forum and i have an interesting problem that i'm hoping to get a little help with! So basically i have an excel file with multiple sheets. I have all of this information in excel sheets because i am transferring the information from one database to another. I have some information in one column of my "ingredients" sheet that i want cut and copied into another column of my "compound" sheet. There is an ID number in the "compound" sheet that links each rows information to a row in the "ingredients" sheet. So based on these ID numbers i want the information from the column in the "ingredient" sheet to be cut and copied into a column of the "compound" sheet. Also, as i don't need all cells of the column to be cut out i have the ones i need marked with red font in order to filter them.

    If my description of the problem isn't clear i will gladly clarify any ambiguities.

    I greatly appreciate any help or advice!

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: cut and paste calculation

    Hi Chemadian,

    Welcome to the forum.
    Would like to see the sample excel workbook also suggest you to put some value instead of marking font in red .. thanks

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Registered User
    Join Date
    07-11-2012
    Location
    Canada
    MS-Off Ver
    Mac 2010
    Posts
    5

    Re: cut and paste calculation

    Hey dilipandey, thanks for the reply!

    Due to the confidential nature of the information i cannot post the exact excel file i'm working on, but i've created a very simple example file that demonstrates what i need help with. What i'm looking to do is cut out Ingredients #2,4,9 and paste them into the "notes" column based on their CompoundID. So for example this means that Ingredient #2 would be pasted into the notes column of compound A because they share the common CompoundID #1.

    Hopefully the example file helps clarify what i'm looking for and i appreciate any further advice!

    cheers
    Attached Files Attached Files

  4. #4
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: cut and paste calculation

    Ingredient #2 would be pasted into the notes column of compound A because they share the common CompoundID #1
    But ingredient #1 and #3 also share the common compound ID.. then what makes ingredient #2 eligible ? Is it the 10gm in column C matching with 10% in Strength in sheet "compound" as both being 10 ?

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  5. #5
    Registered User
    Join Date
    07-11-2012
    Location
    Canada
    MS-Off Ver
    Mac 2010
    Posts
    5

    Re: cut and paste calculation

    DiliPandey, It has nothing to do with the "amounts" "strengths" Quantity of prepare" columns, rather i was hoping that marking ingredient #2,4,9 with red would be enough for a filtered portal to separate those fields out so i could selectively apply a calculation to cut and paste those to the notes section of their parent compound. If this will not work, i appreciate any other options that will accomplish what i'm looking to do.

    cheers

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: cut and paste calculation

    Excel isn't very good at looking up colors (not without programming) so maybe a checkmark column (I used Marlett font and entered "a" where I wanted check marks)
    I used array formulas to move the values you checkmark over to F2 area. You can move them directly to the other sheet or use VLOOKUP or INDEX to move them to where you want them. Take a look at the attachment and see if this is something you can work with.
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  7. #7
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: cut and paste calculation

    Hi Chemadian,

    Okay.. so you can use below formula in that case :-

    {=OFFSET(Ingredient!$B$1,MATCH(Compound!$A2&"y",Ingredient!$A$2:$A$10&Ingredient!$D$2:$D$10,0),0)}

    Note:- Instead of making the font red, suggest you to put y against that row, as shown in attached file

    Above is an array formula and need to be entered with Ctrl + Shift + Enter key combination, see attached:-
    Example Excel File.xlsx

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  8. #8
    Registered User
    Join Date
    07-11-2012
    Location
    Canada
    MS-Off Ver
    Mac 2010
    Posts
    5

    Re: cut and paste calculation

    Thanks for your responses ChemistB & DiliPandey! The formula provided by Dilipandey did the trick! The other problem this leaves me with is as i have to import this information back into another database it doesn't do well with #N/A values in any of the cells. As i applied that formula to the "notes" column in the compound sheet it leaves the rest of the cells with this #N/A value. Is there a way for me to add a modifier into the array formula that will cause the cells that aren't being references to be left blank instead of displaying the #N/A value?

    Thank you for your continued support!

    cheers

  9. #9
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: cut and paste calculation

    {=IFERROR(OFFSET(Ingredient!$B$1,MATCH(Compound!$A2&"y",Ingredient!$A$2:$A$10&Ingredient!$D$2:$D$10,0),0),"")}
    Hope that helps.

  10. #10
    Registered User
    Join Date
    07-11-2012
    Location
    Canada
    MS-Off Ver
    Mac 2010
    Posts
    5

    Re: cut and paste calculation

    You guys are awesome, thank you so much for your help!

  11. #11
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: cut and paste calculation

    Thanks ChemistB for revising the formula ...

    Cheers

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

+ 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