ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Return Numeric Labels that have different Numeric Values (https://www.excelbanter.com/excel-worksheet-functions/121278-return-numeric-labels-have-different-numeric-values.html)

Sam via OfficeKB.com

Return Numeric Labels that have different Numeric Values
 
Hi All,

I would like to compare two sets of Numeric Values: if their values differ
have their corresponding Numeric Label returned across a single row.

I have 4 columns of data spanning 60 rows. The columns of data work in pairs:

Column A Numeric Label "A17:A76"
Column B Numeric Values "B17:B76"

Column D Numeric Label "D17:D76"
Column E Numeric Values "E17:E76"

If a column "B" Numeric Label's value is (NOT equal) < to its corresponding
Numeric Label's value in column "E", then return the Numeric Label of that
Numeric Value.

The Numeric Values in columns "B" and "E" are in descending order. All
Numeric Labels should be returned across a single row.

Sample Data Layout:
Col "A" Col "B" Col "D" Col "E"
Labels Values Labels Values
10 8 15 6
20 4 8 4
15 3 11 3
11 2 4 2

Required Results:
Labels 11 and 15 from column "A" should be returned across a single row as
their numeric values differ - column "B" Value is NOT equal to their
corresponding Value in column "E".

Thanks
Sam

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200612/1


T. Valko

Return Numeric Labels that have different Numeric Values
 
Try this (array entered: CTRL,SHIFT,ENTER):

=INDEX($A$17:$A$76,SMALL(IF(COUNTIF($D$17:$D$76,$A $17:$A$76),IF(SUMIF($A$17:$A$76,$A$17:$A$76,$B$17: $B$76)<SUMIF($D$17:$D$76,$A$17:$A$76,$E$17:$E$76) ,ROW(A$17:A$76)-ROW(A$17)+1)),COLUMNS($A:A)))

Copy across until you get #NUM! errors. If you want an error trap, maybe use
conditional formatting to hide them.

Biff

"Sam via OfficeKB.com" <u4102@uwe wrote in message
news:6a2b8a3ad4eec@uwe...
Hi All,

I would like to compare two sets of Numeric Values: if their values differ
have their corresponding Numeric Label returned across a single row.

I have 4 columns of data spanning 60 rows. The columns of data work in
pairs:

Column A Numeric Label "A17:A76"
Column B Numeric Values "B17:B76"

Column D Numeric Label "D17:D76"
Column E Numeric Values "E17:E76"

If a column "B" Numeric Label's value is (NOT equal) < to its
corresponding
Numeric Label's value in column "E", then return the Numeric Label of that
Numeric Value.

The Numeric Values in columns "B" and "E" are in descending order. All
Numeric Labels should be returned across a single row.

Sample Data Layout:
Col "A" Col "B" Col "D" Col "E"
Labels Values Labels Values
10 8 15 6
20 4 8 4
15 3 11 3
11 2 4 2

Required Results:
Labels 11 and 15 from column "A" should be returned across a single row as
their numeric values differ - column "B" Value is NOT equal to their
corresponding Value in column "E".

Thanks
Sam

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200612/1




Sam via OfficeKB.com

Return Numeric Labels that have different Numeric Values
 
Hi Biff,

Thank you very much. Great Formula!

Is it possible to have the Numeric Labels that are in columns "A" and "D"
returned in ascending order across the row?

Cheers,
Sam

T. Valko wrote:
Try this (array entered: CTRL,SHIFT,ENTER):


=INDEX($A$17:$A$76,SMALL(IF(COUNTIF($D$17:$D$76,$ A$17:$A$76),IF(SUMIF($A$17:$A$76,$A$17:$A$76,$B$17 :$B$76)<SUMIF($D$17:$D$76,$A$17:$A$76,$E$17:$E$76 ),ROW(A$17:A$76)-ROW(A$17)+1)),COLUMNS($A:A)))


Copy across until you get #NUM! errors. If you want an error trap, maybe use
conditional formatting to hide them.


Biff


--
Message posted via http://www.officekb.com


T. Valko

Return Numeric Labels that have different Numeric Values
 
That actually makes it easier (still array entered):

=SMALL(IF(COUNTIF($D$17:$D$76,$A$17:$A$76),IF(SUMI F($A$17:$A$76,$A$17:$A$76,$B$17:$B$76)<SUMIF($D$1 7:$D$76,$A$17:$A$76,$E$17:$E$76),$A$17:$A$76)),COL UMNS($A:A))

Biff

"Sam via OfficeKB.com" <u4102@uwe wrote in message
news:6a2da75e7fa27@uwe...
Hi Biff,

Thank you very much. Great Formula!

Is it possible to have the Numeric Labels that are in columns "A" and "D"
returned in ascending order across the row?

Cheers,
Sam

T. Valko wrote:
Try this (array entered: CTRL,SHIFT,ENTER):


=INDEX($A$17:$A$76,SMALL(IF(COUNTIF($D$17:$D$76, $A$17:$A$76),IF(SUMIF($A$17:$A$76,$A$17:$A$76,$B$1 7:$B$76)<SUMIF($D$17:$D$76,$A$17:$A$76,$E$17:$E$7 6),ROW(A$17:A$76)-ROW(A$17)+1)),COLUMNS($A:A)))


Copy across until you get #NUM! errors. If you want an error trap, maybe
use
conditional formatting to hide them.


Biff


--
Message posted via http://www.officekb.com




T. Valko

Return Numeric Labels that have different Numeric Values
 
You can clean that up and shorten it considerably (to where an error trap
could be added) if you use defined names:

Counts: =COUNTIF($D$17:$D$76,$A$17:$A$76)
Sum1: =SUMIF($A$17:$A$76,$A$17:$A$76,$B$17:$B$76)
Sum2: =SUMIF($D$17:$D$76,$A$17:$A$76,$E$17:$E$76),$A$17: $A$76)
Labels: =$A$17:$A$76

Then:

=SMALL(IF(Counts,IF(Sum1<Sum2,Labels)),COLUMNS($A :A))

With an error trap:

=IF(ISERROR(SMALL(IF(Counts,IF(Sum1<Sum2,Labels)) ,COLUMNS($A:A))),"",SMALL(IF(Counts,IF(Sum1<Sum2, Labels)),COLUMNS($A:A)))

Biff

"T. Valko" wrote in message
...
That actually makes it easier (still array entered):

=SMALL(IF(COUNTIF($D$17:$D$76,$A$17:$A$76),IF(SUMI F($A$17:$A$76,$A$17:$A$76,$B$17:$B$76)<SUMIF($D$1 7:$D$76,$A$17:$A$76,$E$17:$E$76),$A$17:$A$76)),COL UMNS($A:A))

Biff

"Sam via OfficeKB.com" <u4102@uwe wrote in message
news:6a2da75e7fa27@uwe...
Hi Biff,

Thank you very much. Great Formula!

Is it possible to have the Numeric Labels that are in columns "A" and "D"
returned in ascending order across the row?

Cheers,
Sam

T. Valko wrote:
Try this (array entered: CTRL,SHIFT,ENTER):


=INDEX($A$17:$A$76,SMALL(IF(COUNTIF($D$17:$D$76 ,$A$17:$A$76),IF(SUMIF($A$17:$A$76,$A$17:$A$76,$B$ 17:$B$76)<SUMIF($D$17:$D$76,$A$17:$A$76,$E$17:$E$ 76),ROW(A$17:A$76)-ROW(A$17)+1)),COLUMNS($A:A)))


Copy across until you get #NUM! errors. If you want an error trap, maybe
use
conditional formatting to hide them.


Biff


--
Message posted via http://www.officekb.com






T. Valko

Return Numeric Labels that have different Numeric Values
 
Ooops!

Made a mistake in copying/pasting:

Sum2: =SUMIF($D$17:$D$76,$A$17:$A$76,$E$17:$E$76),$A$17: $A$76)


Should be:

Sum2: =SUMIF($D$17:$D$76,$A$17:$A$76,$E$17:$E$76)

Biff

"T. Valko" wrote in message
...
You can clean that up and shorten it considerably (to where an error trap
could be added) if you use defined names:

Counts: =COUNTIF($D$17:$D$76,$A$17:$A$76)
Sum1: =SUMIF($A$17:$A$76,$A$17:$A$76,$B$17:$B$76)
Sum2: =SUMIF($D$17:$D$76,$A$17:$A$76,$E$17:$E$76),$A$17: $A$76)
Labels: =$A$17:$A$76

Then:

=SMALL(IF(Counts,IF(Sum1<Sum2,Labels)),COLUMNS($A :A))

With an error trap:

=IF(ISERROR(SMALL(IF(Counts,IF(Sum1<Sum2,Labels)) ,COLUMNS($A:A))),"",SMALL(IF(Counts,IF(Sum1<Sum2, Labels)),COLUMNS($A:A)))

Biff

"T. Valko" wrote in message
...
That actually makes it easier (still array entered):

=SMALL(IF(COUNTIF($D$17:$D$76,$A$17:$A$76),IF(SUMI F($A$17:$A$76,$A$17:$A$76,$B$17:$B$76)<SUMIF($D$1 7:$D$76,$A$17:$A$76,$E$17:$E$76),$A$17:$A$76)),COL UMNS($A:A))

Biff

"Sam via OfficeKB.com" <u4102@uwe wrote in message
news:6a2da75e7fa27@uwe...
Hi Biff,

Thank you very much. Great Formula!

Is it possible to have the Numeric Labels that are in columns "A" and
"D"
returned in ascending order across the row?

Cheers,
Sam

T. Valko wrote:
Try this (array entered: CTRL,SHIFT,ENTER):

=INDEX($A$17:$A$76,SMALL(IF(COUNTIF($D$17:$D$7 6,$A$17:$A$76),IF(SUMIF($A$17:$A$76,$A$17:$A$76,$B $17:$B$76)<SUMIF($D$17:$D$76,$A$17:$A$76,$E$17:$E $76),ROW(A$17:A$76)-ROW(A$17)+1)),COLUMNS($A:A)))

Copy across until you get #NUM! errors. If you want an error trap, maybe
use
conditional formatting to hide them.

Biff

--
Message posted via http://www.officekb.com








Sam via OfficeKB.com

Return Numeric Labels that have different Numeric Values
 
Hi Biff,

Thank you very much for your assistance. Formula works Great!

Cheers,
Sam

T. Valko wrote:
That actually makes it easier (still array entered):


=SMALL(IF(COUNTIF($D$17:$D$76,$A$17:$A$76),IF(SUM IF($A$17:$A$76,$A$17:$A$76,$B$17:$B$76)<SUMIF($D$ 17:$D$76,$A$17:$A$76,$E$17:$E$76),$A$17:$A$76)),CO LUMNS($A:A))


Biff


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200612/1


Sam via OfficeKB.com

Return Numeric Labels that have different Numeric Values
 
Hi Biff,

Abbreviated, error trapped version much appreciated. Brilliant!

Counts: =COUNTIF($D$17:$D$76,$A$17:$A$76)
Sum1: =SUMIF($A$17:$A$76,$A$17:$A$76,$B$17:$B$76)
Sum2: =SUMIF($D$17:$D$76,$A$17:$A$76,$E$17:$E$76),$A$17: $A$76)
Labels: =$A$17:$A$76


Then:


=SMALL(IF(Counts,IF(Sum1<Sum2,Labels)),COLUMNS($ A:A))


With an error trap:


=IF(ISERROR(SMALL(IF(Counts,IF(Sum1<Sum2,Labels) ),COLUMNS($A:A))),"",SMALL(IF
(Counts,IF(Sum1<Sum2,Labels)),COLUMNS($A:A)))


Cheers,
Sam

T. Valko wrote:
Ooops!


Made a mistake in copying/pasting:


Sum2: =SUMIF($D$17:$D$76,$A$17:$A$76,$E$17:$E$76),$A$17: $A$76)

Should be:


Sum2: =SUMIF($D$17:$D$76,$A$17:$A$76,$E$17:$E$76)


Biff

You can clean that up and shorten it considerably (to where an error trap
could be added) if you use defined names:

[quoted text clipped - 40 lines]

Biff


--
Message posted via http://www.officekb.com


T. Valko

Return Numeric Labels that have different Numeric Values
 
You're welcome. Thanks for the feedback!

Biff

"Sam via OfficeKB.com" <u4102@uwe wrote in message
news:6a2eca8d2d648@uwe...
Hi Biff,

Abbreviated, error trapped version much appreciated. Brilliant!

Counts: =COUNTIF($D$17:$D$76,$A$17:$A$76)
Sum1: =SUMIF($A$17:$A$76,$A$17:$A$76,$B$17:$B$76)
Sum2: =SUMIF($D$17:$D$76,$A$17:$A$76,$E$17:$E$76),$A$17: $A$76)
Labels: =$A$17:$A$76


Then:


=SMALL(IF(Counts,IF(Sum1<Sum2,Labels)),COLUMNS( $A:A))


With an error trap:


=IF(ISERROR(SMALL(IF(Counts,IF(Sum1<Sum2,Labels )),COLUMNS($A:A))),"",SMALL(IF
(Counts,IF(Sum1<Sum2,Labels)),COLUMNS($A:A)))


Cheers,
Sam

T. Valko wrote:
Ooops!


Made a mistake in copying/pasting:


Sum2: =SUMIF($D$17:$D$76,$A$17:$A$76,$E$17:$E$76),$A$17: $A$76)

Should be:


Sum2: =SUMIF($D$17:$D$76,$A$17:$A$76,$E$17:$E$76)


Biff

You can clean that up and shorten it considerably (to where an error
trap
could be added) if you use defined names:

[quoted text clipped - 40 lines]

Biff


--
Message posted via http://www.officekb.com





All times are GMT +1. The time now is 04:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com