PC Review


Reply
Thread Tools Rate Thread

Array problem? List comparison?

 
 
Erwin
Guest
Posts: n/a
 
      29th Apr 2010
Hey,

Let me set up what I'm trying to do. I have 3 columns with the
following data.

A: 10, 20, 30
B: X, Y, Z

C: 28, 8, 1

Now, I have a last column, D, which I'm trying to figure out the
correct formula for.
I want D to return the following:
Look at column A, find the smallest number that's greater than the
adjacent cell in column C, and then return the adjacent cell in column
B.

So, in this example, column D should read:
D: Z, X, X

I can't figure this out. I think it has to do with arrays, but I'm not
too sure. If anyone has any insight on how to accomplish this, I would
really appreciate it. Thanks so much!
 
Reply With Quote
 
 
 
 
Jacob Skaria
Guest
Posts: n/a
 
      29th Apr 2010
Hi Erwin

Try the below in cell D1 and copy down as required.

Please note that this is an array formula. You create array formulas in the
same way that you create other formulas, except you press CTRL+SHIFT+ENTER to
enter the formula. If successful in 'Formula Bar' you can notice the curly
braces at both ends like "{=<formula>}"

=VLOOKUP(SMALL(IF($A$1:$A$10>C1,$A$1:$A$10),1),$A$1:$B$10,2,0)

--
Jacob (MVP - Excel)


"Erwin" wrote:

> Hey,
>
> Let me set up what I'm trying to do. I have 3 columns with the
> following data.
>
> A: 10, 20, 30
> B: X, Y, Z
>
> C: 28, 8, 1
>
> Now, I have a last column, D, which I'm trying to figure out the
> correct formula for.
> I want D to return the following:
> Look at column A, find the smallest number that's greater than the
> adjacent cell in column C, and then return the adjacent cell in column
> B.
>
> So, in this example, column D should read:
> D: Z, X, X
>
> I can't figure this out. I think it has to do with arrays, but I'm not
> too sure. If anyone has any insight on how to accomplish this, I would
> really appreciate it. Thanks so much!
> .
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fast byte array comparison for ordering purposes Christopher Van Kirk Microsoft Dot NET 0 29th Feb 2008 01:43 AM
IComparable Byte-Array Comparison Stephen.Schoenberger@gmail.com Microsoft C# .NET 1 3rd May 2007 01:50 PM
strange problem displaying array in list box Graham Whitehead Microsoft Excel Programming 1 15th Nov 2006 02:45 PM
Byte Array Comparison Not Accurate - MD5CryptoServiceProvider =?Utf-8?B?S2F6?= Microsoft Dot NET Framework 4 19th May 2006 04:56 PM
Randomized Paired Comparison Array John Michl Microsoft Excel Programming 3 20th Oct 2005 10:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:37 PM.