Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thanks ... works perfectly!!! :)
-- nikko "T. Valko" wrote: if there are 2 similar dates with different contact person Ok, it gets complicated! Here's a small sample file that demonstrates this. xNikko.xls 17kb http://cjoint.com/?efhZw8gEFM -- Biff Microsoft Excel MVP "nikko" wrote in message ... Thanks ... it works perfectly. Now with the dates returned in ascending order, i'm trying to return the related activity comments and contact person. however if there are 2 similar dates with different contact person, the formula does not seen to work .. desired results Date Contact Person 25-Mar Peter 25-Mar Alan formula is returning Date Contact Person 25-Mar Peter 25-Mar Peter Formula - (INDEX('Data3-Opp Activities Info'!$A$1:$J$10000,SMALL(IF('Data3-Opp Activities Info'!$C$1:$C$10000='Opportunity (3)'!$J$2&H25,ROW('Data3-Opp Activities Info'!$C$1:$C$10000)),ROW(1:1)),7))) -- nikko "T. Valko" wrote: This will extract the dates in ascending order, oldest to newest, that meet the condition. I'm leaving out the sheet name so be sure to add it to your formula. Let's assume you want the results starting in cell X1. Array entered** : =SMALL(IF(A$1:A$13=J$2,H$1:H$13),ROWS(X$1:X1)) Copy down until you get #NUM! errors meaning all applicable data has been extracted. If you want an error trap: =IF(ROWS(X$1:X1)<=COUNTIF(A$1:A$13,J$2),SMALL(IF(A $1:A$13=J$2,H$1:H$13),ROWS(X$1:X1)),"") Copy down until you get blanks meaning all applicable data has been extracted. ** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER. -- Biff Microsoft Excel MVP "nikko" wrote in message ... the returned values are dates format... & i jus want to return the dates from oldest to newest... -- nikko "T. Valko" wrote: Explain what you're wanting to do. I know what the formula does but what do you mean by: sorted order i.e.the most recent activity showing up first? That sounds to me like you're looking for dates? -- Biff Microsoft Excel MVP "nikko" wrote in message ... Sorry .. didnt get wad you mean... -- nikko "T. Valko" wrote: Refresh my memory. -- Biff Microsoft Excel MVP "nikko" wrote in message ... Hi Biff Using below formula and its returning the values not in sequence =INDEX('Data3-Opp Activities Info'!H$1:H$13,SMALL(IF('Data3-Opp Activities Info'!A$1:A$13=$J$2,ROW($1:$13)),ROW(1:1))) is there a way to return the corresponding values in sorted order i.e. w the most recent activity showing up first? Thanks you! -- nikko "Biff" wrote: in the formula, it looks like were mutliplying the rng2 valule by the corresponding value in rng3, however the rng2 value is not a number. it is in most cases text. not sure if that is the problem. No, it's not a problem. It's not actually multiplying numbers. It's multiplying logical tests that return either TRUE or FALSE. For example: ('PO Detail'!B$1:B$500=$B$3)*('PO Detail'!K$1:K$5000) This will return an array like this: (TRUE)*(TRUE) (TRUE)*(FALSE) (FALSE)*(TRUE) (FALSE)*(FALSE) These logicals are multiplied together and result in an array of 1's or 0's where 1 evalautes to the value_if_true and 0 evaluates to the value_if_false. The value_if_true is a number from 1 to 500 that's derived from this expression: ROW(INDIRECT("1:"&ROWS('PO Detail'!B$1:B$500)) When the value_if_true condition is met then the corresponding numbers from that expression are then passed to the Small function. ..here is my exact formula (Array entered) =INDEX('PO Detail'!D$1:D$500,SMALL(IF(('PO Detail'!B$1:B$500=$B$3)*('PO Detail'!K$1:K$5000),ROW(INDIRECT("1:"&ROWS('PO Detail'!B$1:B$500)))),ROW('PO Detail'!B18))) If you're not using dynamic named ranges then I would "dummy down" this portion: ROW(INDIRECT("1:"&ROWS('PO Detail'!B$1:B$500)) To: ROW($1:$500) You don't actually need the sheet name or the cell references but you'll see where some people use them just for a better understanding. Biff "gfactor" wrote in message ... biff, thanks for your help...getting an error. here is what you recommended: =INDEX(Rng2,SMALL(IF((Rng1=$z$1)*(Rng30),ROW(INDI RECT("1:"&ROWS(Rng2)))),ROW(A1))) ..here is my exact formula (Array entered) =INDEX('PO Detail'!D$1:D$500,SMALL(IF(('PO Detail'!B$1:B$500=$B$3)*('PO Detail'!K$1:K$5000),ROW(INDIRECT("1:"&ROWS('PO Detail'!B$1:B$500)))),ROW('PO Detail'!B18))) its still bringing back values from range 2 if range 3 is 0. in the formula, it looks like were mutliplying the rng2 valule by the corresponding value in rng3, however the rng2 value is not a number. it is in most cases text. not sure if that is the problem. maybe we can just check to see if rng3 is 0? i tried this, but syntax wasn't right. any thoughts? thanks in advance, g "Biff" wrote: i only want the result delivered if the value in (rng3) is "0" Try this: (array entered) =INDEX(Rng2,SMALL(IF((Rng1=$z$1)*(Rng30),ROW(INDI RECT("1:"&ROWS(Rng2)))),ROW(A1))) Biff "gfactor" wrote in message ... biff - you nailed it kid. got the result i was looking for in terms of being able to have a variable length array. here's my next question: lets assume my formula reads as follows: =INDEX(Rng2,SMALL(IF(Rng1=$z$1,ROW(INDIRECT("1:"&R OWS(Rng2)))),ROW(A1))) ...and my data looks like this: a(rng2) b(rng1) c (rng4) 1 y1 p1 5 2 x1 p2 1 3 y1 p3 0 4 z1 p4 3 5 q1 p5 4 if my $z$1 value is "y1"...the formula returns 2 data sets: y1 p1 y1 p3 the thing is, i only want the result delivered if the value in (rng3) is "0" can you help me? thanks in advance. g "Biff" wrote: |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
You're welcome. Thanks for the feedback!
-- Biff Microsoft Excel MVP "nikko" wrote in message ... Thanks ... works perfectly!!! :) -- nikko "T. Valko" wrote: if there are 2 similar dates with different contact person Ok, it gets complicated! Here's a small sample file that demonstrates this. xNikko.xls 17kb http://cjoint.com/?efhZw8gEFM -- Biff Microsoft Excel MVP "nikko" wrote in message ... Thanks ... it works perfectly. Now with the dates returned in ascending order, i'm trying to return the related activity comments and contact person. however if there are 2 similar dates with different contact person, the formula does not seen to work .. desired results Date Contact Person 25-Mar Peter 25-Mar Alan formula is returning Date Contact Person 25-Mar Peter 25-Mar Peter Formula - (INDEX('Data3-Opp Activities Info'!$A$1:$J$10000,SMALL(IF('Data3-Opp Activities Info'!$C$1:$C$10000='Opportunity (3)'!$J$2&H25,ROW('Data3-Opp Activities Info'!$C$1:$C$10000)),ROW(1:1)),7))) -- nikko "T. Valko" wrote: This will extract the dates in ascending order, oldest to newest, that meet the condition. I'm leaving out the sheet name so be sure to add it to your formula. Let's assume you want the results starting in cell X1. Array entered** : =SMALL(IF(A$1:A$13=J$2,H$1:H$13),ROWS(X$1:X1)) Copy down until you get #NUM! errors meaning all applicable data has been extracted. If you want an error trap: =IF(ROWS(X$1:X1)<=COUNTIF(A$1:A$13,J$2),SMALL(IF(A $1:A$13=J$2,H$1:H$13),ROWS(X$1:X1)),"") Copy down until you get blanks meaning all applicable data has been extracted. ** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER. -- Biff Microsoft Excel MVP "nikko" wrote in message ... the returned values are dates format... & i jus want to return the dates from oldest to newest... -- nikko "T. Valko" wrote: Explain what you're wanting to do. I know what the formula does but what do you mean by: sorted order i.e.the most recent activity showing up first? That sounds to me like you're looking for dates? -- Biff Microsoft Excel MVP "nikko" wrote in message ... Sorry .. didnt get wad you mean... -- nikko "T. Valko" wrote: Refresh my memory. -- Biff Microsoft Excel MVP "nikko" wrote in message ... Hi Biff Using below formula and its returning the values not in sequence =INDEX('Data3-Opp Activities Info'!H$1:H$13,SMALL(IF('Data3-Opp Activities Info'!A$1:A$13=$J$2,ROW($1:$13)),ROW(1:1))) is there a way to return the corresponding values in sorted order i.e. w the most recent activity showing up first? Thanks you! -- nikko "Biff" wrote: in the formula, it looks like were mutliplying the rng2 valule by the corresponding value in rng3, however the rng2 value is not a number. it is in most cases text. not sure if that is the problem. No, it's not a problem. It's not actually multiplying numbers. It's multiplying logical tests that return either TRUE or FALSE. For example: ('PO Detail'!B$1:B$500=$B$3)*('PO Detail'!K$1:K$5000) This will return an array like this: (TRUE)*(TRUE) (TRUE)*(FALSE) (FALSE)*(TRUE) (FALSE)*(FALSE) These logicals are multiplied together and result in an array of 1's or 0's where 1 evalautes to the value_if_true and 0 evaluates to the value_if_false. The value_if_true is a number from 1 to 500 that's derived from this expression: ROW(INDIRECT("1:"&ROWS('PO Detail'!B$1:B$500)) When the value_if_true condition is met then the corresponding numbers from that expression are then passed to the Small function. ..here is my exact formula (Array entered) =INDEX('PO Detail'!D$1:D$500,SMALL(IF(('PO Detail'!B$1:B$500=$B$3)*('PO Detail'!K$1:K$5000),ROW(INDIRECT("1:"&ROWS('PO Detail'!B$1:B$500)))),ROW('PO Detail'!B18))) If you're not using dynamic named ranges then I would "dummy down" this portion: ROW(INDIRECT("1:"&ROWS('PO Detail'!B$1:B$500)) To: ROW($1:$500) You don't actually need the sheet name or the cell references but you'll see where some people use them just for a better understanding. Biff "gfactor" wrote in message ... biff, thanks for your help...getting an error. here is what you recommended: =INDEX(Rng2,SMALL(IF((Rng1=$z$1)*(Rng30),ROW(INDI RECT("1:"&ROWS(Rng2)))),ROW(A1))) ..here is my exact formula (Array entered) =INDEX('PO Detail'!D$1:D$500,SMALL(IF(('PO Detail'!B$1:B$500=$B$3)*('PO Detail'!K$1:K$5000),ROW(INDIRECT("1:"&ROWS('PO Detail'!B$1:B$500)))),ROW('PO Detail'!B18))) its still bringing back values from range 2 if range 3 is 0. in the formula, it looks like were mutliplying the rng2 valule by the corresponding value in rng3, however the rng2 value is not a number. it is in most cases text. not sure if that is the problem. maybe we can just check to see if rng3 is 0? i tried this, but syntax wasn't right. any thoughts? thanks in advance, g "Biff" wrote: i only want the result delivered if the value in (rng3) is "0" Try this: (array entered) =INDEX(Rng2,SMALL(IF((Rng1=$z$1)*(Rng30),ROW(INDI RECT("1:"&ROWS(Rng2)))),ROW(A1))) Biff "gfactor" wrote in message ... biff - you nailed it kid. got the result i was looking for in terms of being able to have a variable length array. here's my next question: lets assume my formula reads as follows: =INDEX(Rng2,SMALL(IF(Rng1=$z$1,ROW(INDIRECT("1:"&R OWS(Rng2)))),ROW(A1))) ...and my data looks like this: a(rng2) b(rng1) c (rng4) 1 y1 p1 5 2 x1 p2 1 3 y1 p3 0 4 z1 p4 3 5 q1 p5 4 if my $z$1 value is "y1"...the formula returns 2 data sets: y1 p1 y1 p3 the thing is, i only want the result delivered if the value in (rng3) is "0" can you help me? thanks in advance. g "Biff" wrote: |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Huge problem with "if" formula's | Excel Discussion (Misc queries) | |||
Return range of values on an "IF" statement | Excel Worksheet Functions | |||
How do I return the cell address of the largest of a set of values | Excel Discussion (Misc queries) | |||
Adding multiple cells, return specific values | Excel Worksheet Functions | |||
Lookup values in a list and return multiple rows of data | Excel Worksheet Functions |