+ Reply to Thread
Results 1 to 6 of 6

How to return value if several conditions are met?

  1. #1
    Registered User
    Join Date
    01-20-2012
    Location
    Zagreb
    MS-Off Ver
    Excel 2010
    Posts
    2

    How to return value if several conditions are met?

    If someone is willing to help...

    One sheet contains costs data - by provider, person, number and service.

    I need monthly overview of costs per person, for given provider, service, person and number.

    Please see attached file.mobiles.xlsx

  2. #2
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: How to return value if several conditions are met?

    Hi,

    Have you looked at using a pivot table?

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

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

    Re: How to return value if several conditions are met?

    Try:

    =SUMIFS(DATA!$I:$I,DATA!$A:$A,$B$4,DATA!$E:$E,$B$5,DATA!$D:$D,$A8,DATA!$C:$C,$B8,DATA!$B:$B,C$7)

    adjusting the B4 and B5 to B14, B15 for new table and new provider/service, etc.
    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.

  4. #4
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: How to return value if several conditions are met?

    For formula it would be:

    =SUMIFS(DATA!$I$4:$I$19,DATA!$A$4:$A$19,$B$4,DATA!$E$4:$E$19,$B$5,DATA!$D$4:$D$19,$A8,DATA!$C$4:$C$19,$B8,DATA!$B$4:$B$19,C$7)

    or in pre Excel 2007:

    =SUMPRODUCT(--(DATA!$A$4:$A$19=$B$4),--(DATA!$E$4:$E$19=$B$5),--(DATA!$D$4:$D$19=$A8),--(DATA!$C$4:$C$19=$B8),--(DATA!$B$4:$B$19=C$7),DATA!$I$4:$I$19)

    Entered in C8 and copied across and down.

    Dom

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: How to return value if several conditions are met?

    Hi and welcome to the Forum...

    In c8,of the result sheet, try this.

    =SUMPRODUCT((((DATA!D4:D19=RESULTS!A8)*(DATA!C4:C19=RESULTS!B8)*(DATA!B4:B19=RESULTS!C7)*(DATA!I4:I19))))

    Same way for the others

    Hope to helps you.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  6. #6
    Registered User
    Join Date
    01-20-2012
    Location
    Zagreb
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: How to return value if several conditions are met?

    Sorry for not thanking you all earlier for your answers.

    I've tried pivot table and it gave me results I needed. But I will look at other suggestions to learn new things!

+ 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