+ Reply to Thread
Results 1 to 10 of 10

find, meet condition, sum range, deduce, find next

  1. #1
    Registered User
    Join Date
    09-23-2007
    Posts
    29

    some kind of variation of sumif, match, sumproduct

    i have spent 40 hours, and still didn't find a solution. Please help is need it!!
    example:
    i have to find all articles with same code (222). first one has Q =100 second one Q=250.
    soled Q=150

    (i am talking about 5000 rows, 400 different or same articles per month- 12 months)


    columnA-----columnB---columnC
    222 ----------100---------0
    111-----------50
    333-----------70
    222----------200---------200
    333---------- and so on
    first i have to deduct from the first one it finds (max. till 0 ...it can not be negative) ....after finding another one it deducts the rest---it means 50
    Is there any kind of formula with this possibility.
    if it is poorly writen please let me know for more info.
    i am not an expert in excell, but i have tried variations of sumif, vlookup functions, but i always get stuck deducting the whole Quantity from all of the same (222) articles .
    thank you for your kind help
    Last edited by pinstripe; 09-23-2007 at 06:53 PM.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Quote Originally Posted by pinstripe
    first one has Q =100 second one Q=250.
    soled Q=150
    Hello pinstripe,

    It's a little difficult to follow your explanation. What does the above mean? You show column C with some numbers, are these the results you are trying to get or existing data?

  3. #3
    Registered User
    Join Date
    09-23-2007
    Posts
    29
    Quote Originally Posted by daddylonglegs
    Hello pinstripe,

    It's a little difficult to follow your explanation. What does the above mean? You show column C with some numbers, are these the results you are trying to get or existing data?
    HI, i am very gratefull for your reply! Yes, in column C are the results.
    to explain better:
    columnA is an article code, columnB is a Quantity on stock, in columnC are results. In separate sheet i have in columnA aricle codes and in column B soled Quantities. With SUMIF i can sum all sold quantites by aricle code but, then i don't know how to deduct the given number with all the articles - like explained abowe.
    Is this clearer ?
    thenks for your help

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    Can you attached a zipped copy of your example spreadsheet. In it can you explain what number you want to go where, and for 1 or 2, show the result you expect from the data given.


    rylo

  5. #5
    Registered User
    Join Date
    09-23-2007
    Posts
    29
    final result in column ..."this should be the resoult"
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    What happens if you make:
    AC2: =IF(ISNUMBER(FIND("WW",B2)),1,0)
    AH2: =IF(AND(ISNUMBER(FIND("WW",B2)),AB2=0),0,1)

    If that doesn't solve it, then can you explain what result you would expect to find where, and explain why it should occur. Pick 1 or 2 rows to explain things.


    rylo

  7. #7
    Registered User
    Join Date
    09-23-2007
    Posts
    29
    thanks for replay.
    Well, in columnZ is what comes in and in AA is what is sold.In AB is the differenc of that for each article. In AF is how much have to be upsided for each article to get 0 value - just for those which are in negative numbers in AB. In AH i get 1 for those which name of the article includes WW letter, beacuse these are inported in barels and then repacked to the smaller ones with same UPV (column C)code.
    So, i need to sum up all values in AC with same code (columnC) and deduct from those which has same code but also WW in the name.

    The problem is with my formulas it deducts from all WW articles with the same code insted of one. And after first one with positive value hits 0 it should deduct from second one it finds with same code and WW in the name. So, in column AH i am puting 1 so i know it has WW in name (from which will be deducted) and in AG should come out the final value for those...for others without WW - 0.
    Please, bare with me

  8. #8
    Registered User
    Join Date
    09-23-2007
    Posts
    29

    find, meet condition, sum range, deduce, find next

    Hi,
    i have gone through the internet with no luck to find a solution for my problem....and i have to say i am not to good with vba.

    Problem:
    ColumnA - article name
    ColumnB - article code
    ColumnC - quantity
    ColumnD - month (e.g. 200701- january)
    ColumnE - result (X)

    i have 12 different ranges (for every month, about 400 article per month)
    in columnA - articles have WW in name, sub articles are without --they are condected by the same code (columnB)
    What i need to do is, in columnE - take first article code in (B1),
    sum quantites of all aricles with the same code but wihout WW in name, go through columnA find article with the same artilce code and with WW in name, - then deduct the sum from first find of WW with same code (if not negative), else find next and deduct from that.

    how can this be accomplished?
    thx for help

  9. #9
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    Your description above doesn't seem to match the format of the sample file you have provided.

    Can you either change the description, or put up a new sample file.

    Then can you give a worked example from your data. Select the code, the sub code etc, show what they are, and from the numbers given, show what the result should be and how it was calculated.

    rylo

  10. #10
    Registered User
    Join Date
    09-23-2007
    Posts
    29
    i have decided not to do this in excell but in access insted.

    I would like to thank you all, for help and will you have given me.
    thx

+ 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