+ Reply to Thread
Results 1 to 7 of 7

Return value based off 2 criteria.

  1. #1
    Registered User
    Join Date
    04-10-2010
    Location
    DFW, Tx
    MS-Off Ver
    Excel 2007
    Posts
    5

    Question Return value based off 2 criteria.

    I can't seem to figure out how to return a value from a cell based on 2 criterias. Date(columns) and #'s(Row). I've tried sumif, sumifs. sumproduct...

    I've attached a sample to show what I'm needing. I need cell B6 on the "display" sheet to find how many instances occured on 4/1 from set 13.

    Many thanks for any help. I've spent many hours reading all the great info on this site. Very helpful..
    Attached Files Attached Files
    Last edited by iamdavid; 04-11-2010 at 05:38 PM.

  2. #2
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Return value based off 2 criteria.

    try in Br

    =INDEX(data!$B$3:$I$65,MATCH(display!$A3,data!$A$3:$A$65,0),MATCH(display!B$2,data!$B$2:$I$2,0))

    or

    1 =HLOOKUP(display!B$2,data!$B$2:$I$65,MATCH(display!$A3,data!$A$2:$A$65,0),0)
    2 =VLOOKUP($A3,data!$A$2:$I$65,MATCH(display!B$2,data!$A$2:$I$2,0),0)
    3 =OFFSET(data!$A$2,MATCH(display!$A3,data!$A$3:$A$65,0),MATCH(display!B$2,data!$B$2:$I$2,0))
    4 =INDIRECT(ADDRESS(MATCH(display!$A3,data!$A$3:$A$65,0)+ROW(data!$A$2),MATCH(display!B$2,data!$B$2:$I$2,0)+COLUMN(data!$A$2),,,"data"))
    copy down then across
    Last edited by contaminated; 04-10-2010 at 05:03 PM.
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Return value based off 2 criteria.

    If DATA is an actual Pivot Table (rather then copied values) you could also use the GETPIVOTDATA function.

    If the above is the case then you can encase the GETPIVOTDATA call within an IFERROR function to account for possibility of set / date combination not appearing with the PT Data Table.

    GETPIVOTDATA function has the advantage that it will adjust all references as and when the Pivot itself refreshes (ie no ranges will need adjusting based on it's location, size etc...)

  4. #4
    Registered User
    Join Date
    04-11-2010
    Location
    bucharest
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Return value based off 2 criteria.

    Please help me to find a formula able to return in a specific cell the 2 last numbers of a bar code only if it starts with a specified string.
    Thank you in advance!

  5. #5
    Registered User
    Join Date
    04-10-2010
    Location
    DFW, Tx
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Return value based off 2 criteria.

    Quote Originally Posted by DonkeyOte View Post
    If DATA is an actual Pivot Table (rather then copied values) you could also use the GETPIVOTDATA function.

    If the above is the case then you can encase the GETPIVOTDATA call within an IFERROR function to account for possibility of set / date combination not appearing with the PT Data Table.

    GETPIVOTDATA function has the advantage that it will adjust all references as and when the Pivot itself refreshes (ie no ranges will need adjusting based on it's location, size etc...)
    Thanks DonkeyOte! The GETPIVOTDATA is a wonderful tool for this. One more question though.. The real page I'm using this pulls from a page with over 100 days and over 100 set(rows) within the pivot table. When I copy the formula from one cell to the next it keeps it exactly the same instead of changing the date to the next. Any way I can have it do this instead of changing each cell to the corresponding date?

    Thanks again!..


    BTW: I know this a probably a strange need for someone but it's the only option I can find that will allow me to display the data I'm trying to compile. The main sheet will actually be pulling info off multiple pivot tables being generated out of 3 different databases. I've set it all up except for this final summary sheet. Thanks!!

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Return value based off 2 criteria.

    Yes, you can use "variables" for the various PT "item" criteria, eg:

    B2: =IFERROR(GETPIVOTDATA(fieldofinterest,PTlocation,fieldname1,$A2,fieldname1,B$1),0)

    as you copy B2 across the matrix so references A2 and B1 will adjust accordingly

  7. #7
    Registered User
    Join Date
    04-10-2010
    Location
    DFW, Tx
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Return value based off 2 criteria.

    Quote Originally Posted by DonkeyOte View Post
    Yes, you can use "variables" for the various PT "item" criteria, eg:

    B2: =IFERROR(GETPIVOTDATA(fieldofinterest,PTlocation,fieldname1,$A2,fieldname1,B$1),0)

    as you copy B2 across the matrix so references A2 and B1 will adjust accordingly
    Thanks for the quick responses and excellent help. It works great!!!

+ 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