+ Reply to Thread
Results 1 to 10 of 10

How to evaluate multiple fields and if criteria is met, post appropriate data

  1. #1
    Registered User
    Join Date
    08-09-2010
    Location
    Fort Bliss
    MS-Off Ver
    Excel 2007
    Posts
    5

    How to evaluate multiple fields and if criteria is met, post appropriate data

    I apologize for the awkward title, but I really don't know how else to briefly state what I want to accomplish.

    I hope I don't use up all the internet ink here...

    A_________B________________C______________D_______________E
    1__|_TYPE OF ANIMAL__|__QUANTITY__|_TYPE OF ANIMAL__|__QUANTITY
    2__|______Dog________|____7________|______Pig__________|______0
    3__|______Bird________|____5________|______Cow_________|______3
    4__|______Cat________|____ 4________|______Goose________|_____9

    *(RANGE NAME OF B2:B4, D2-D4 = REQUEST)

    If the value of B2:B4 or D2:D4 = Cat, then place the quantity listed in Z4. If B2:B4 or D2:D4 does not equal Cat, then leave Z4 blank (preferred) or display zero.

    X_________Y_______________Z
    1__|__TYPE OF ANIMAL_|__QUANTITY
    2__|_____Dog________|___________
    3__|_____Bird________|___________
    4__|_____Cat________|___________
    5__|_____Pig________|___________
    6__|_____Cow________|___________
    7__|_____Goose______|___________
    8__|_____Donkey_____|___________

    *(RANGE NAME OF Y2:Y8 = INVENTORY)
    The REQUEST area allows the customer to enter the six types of animals they selected and the quantity of each they need.

    The INVENTORY area lists all animals available. Since a customer may only select six different animals (but can choose fewer), not every animal in this list will have a value listed beside it.

    The formula that was given to me is cumbersome and bulky. I told the person I am helping that there has to be a cleaner method. The current formulas (found in cells Z2:Z8) are set up like this: (this example would be from Z2 and is expanded for easier reading)

    Please Login or Register  to view this content.
    This example formula probably doesn’t look too messy, but consider that this is a tiny example. The real spreadsheet has an inventory that lists 73 items. The problem was shared with me because the original formula had too many nested IFs and the current workaround is, in my opinion, gross. See for yourself…
    Please Login or Register  to view this content.
    If my ASCII art spreadsheet is too hard to work with, please let me know and I will take some screenshots and post those instead.

    Thanks for your time.
    Last edited by rayzon; 08-10-2010 at 01:19 PM. Reason: Solved

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: How to evaluate multiple fields and if criteria is met, post appropriate data

    Maybe:

    =SUMIF('TY 11 Class V Justification'!$Q$16:$S$24,'Class V Forecast by Month'!$A3,'TY 11 Class V Justification'!$R$16:$T$24)

    you can hide any 0 value by custom formatting the result cells as: 0;-0;;@
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    08-09-2010
    Location
    Fort Bliss
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: How to evaluate multiple fields and if criteria is met, post appropriate data

    Thanks for the reply. I appreciate the suggestion, but it doesn't produce the desired results.

    I've been working on a clearer way to express what I am trying to accomplish. I think these two images will better explain.

    The user will enter up to 18 DODIC #'s and will list the required quantity. In the justification.jpg, you can see that the user needs

    --3,172 units of A011
    --6,500 units of A063
    --etc

    The image also demonstrates that althought the user has the ability to select 18 different DODICs, they don't have to.

    The other image, forecast.jpg, lists all DODICs (there are 73 different DODICs). Since the user can select no more than 18 of these, not every cell will list a forecasted quantity.

    I need the requested amount for each DODIC from justification.jpg to post in the appropriate cell on forecast.jpg. In other words, I need Excel to recognize that the user needs 3,172 units of A011 and to post 3,172 in cell B4. Then recognize that the user needs 6,500 units of A063 and place 6,500 in cell B7.

    I hope this makes it more clear.
    Attached Images Attached Images

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: How to evaluate multiple fields and if criteria is met, post appropriate data

    Try attaching an actual workbook sample so tests can be done and presented.

    The sooner the better..cause I am logging out soon.

  5. #5
    Registered User
    Join Date
    08-09-2010
    Location
    Fort Bliss
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: How to evaluate multiple fields and if criteria is met, post appropriate data

    Here you go.
    Attached Files Attached Files

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: How to evaluate multiple fields and if criteria is met, post appropriate data

    Did you try this in K3 of the Class V Forecast by Month sheet?

    =SUMIF('TY 11 Class V Justification'!$Q$16:$S$24,A3,'TY 11 Class V Justification'!$R$16:$T$24)

    copied down... I seem to get correct results.. and I said, you can hide the 0's by custom formatting the columns to: 0;-0;;@

  7. #7
    Registered User
    Join Date
    08-09-2010
    Location
    Fort Bliss
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: How to evaluate multiple fields and if criteria is met, post appropriate data

    OUTSTANDING!

    Great job. I appreciate your help.

    So many formulas, unless used frequently, it is hard to retain an understanding of them.

    I'm gonna do my own digging regarding SUMIF, but would you mind giving me a brief explanation of what led you to SUMIF, aside from the obvious answer of it works?

    I knew there had to be a cleaner way of setting this up.

    Again, thank you for your time and skills.

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: How to evaluate multiple fields and if criteria is met, post appropriate data

    Well, I can see that you were summing values in one column based on matches to a specific input cell on another column, and I could see that you had a setup that is conducive to using SUMIF.

    Normally, one would use SUMIF on single range input and output.. e.g.

    =Sumif(A1:A10,X1,B1:B10)

    but if you have a table setup such as yours is, where you have alternating lookup columns and amount columns, then you could expand Sumif to incorporate those, ie.

    =Sumif(A1:C10,X1,B1:D10) ... noticing the offsetting of ranges to start at first lookup column and end at last lookup column and then for sum ranges, similarily start at first summing column and ending at last summing column.

  9. #9
    Registered User
    Join Date
    08-09-2010
    Location
    Fort Bliss
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: How to evaluate multiple fields and if criteria is met, post appropriate data

    Ah, okay. So we're taking the sum of all those cells that meet the criteria. In theory the user's should only have one instance of a particular DODIC and therefore the sum of all DODICs meeting the criteria is that one cell.

    However, if the user were to goof up and enter the same DODIC more than once, the formula would sum multiple cells.

    Seriously, thanks for your help. Have a great day.

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: How to evaluate multiple fields and if criteria is met, post appropriate data

    Exactly.... don't let them goof up!

+ 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