Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 19
Default max function with a less than or equal to

I am looking for a way to utilize the max or maxa functions that returns a
value depending on if it's less than a value. Assume:

B1 value is 8
A1:A5 values a
2
4
6
9
15

I want a function that returns one of the values in A1:A5 that is the
largest number less than B1. This example would return the value 6. I
basically need a max function something like this:

Max(A1:A5)<B1 (Return the maximum number of A1:A5 that's less than B1)

This returns a false statement because the maximum number of A1:A5 is not
less than B1, but I want the value of 6 to be returned because it is the
largest number in the array that's less than B1. PLEASE HELP.

Thanks in advance for anything from anyone!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,440
Default max function with a less than or equal to

=VLOOKUP(B1-0.000000000001,A1:A5,1)

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"masterbaker" wrote in message ...
|I am looking for a way to utilize the max or maxa functions that returns a
| value depending on if it's less than a value. Assume:
|
| B1 value is 8
| A1:A5 values a
| 2
| 4
| 6
| 9
| 15
|
| I want a function that returns one of the values in A1:A5 that is the
| largest number less than B1. This example would return the value 6. I
| basically need a max function something like this:
|
| Max(A1:A5)<B1 (Return the maximum number of A1:A5 that's less than B1)
|
| This returns a false statement because the maximum number of A1:A5 is not
| less than B1, but I want the value of 6 to be returned because it is the
| largest number in the array that's less than B1. PLEASE HELP.
|
| Thanks in advance for anything from anyone!


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 19
Default max function with a less than or equal to

Thanks Niek, that works.

Would you mind telling me how the hell that works??? Essentially it's
looking up a value that doesn't exist, so what is it actually looking up??

THanks a ton!!


"Niek Otten" wrote:

=VLOOKUP(B1-0.000000000001,A1:A5,1)

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"masterbaker" wrote in message ...
|I am looking for a way to utilize the max or maxa functions that returns a
| value depending on if it's less than a value. Assume:
|
| B1 value is 8
| A1:A5 values a
| 2
| 4
| 6
| 9
| 15
|
| I want a function that returns one of the values in A1:A5 that is the
| largest number less than B1. This example would return the value 6. I
| basically need a max function something like this:
|
| Max(A1:A5)<B1 (Return the maximum number of A1:A5 that's less than B1)
|
| This returns a false statement because the maximum number of A1:A5 is not
| less than B1, but I want the value of 6 to be returned because it is the
| largest number in the array that's less than B1. PLEASE HELP.
|
| Thanks in advance for anything from anyone!



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,069
Default max function with a less than or equal to

Niek's solution is making use of the Range_Lookup argument of the VLOOKUP
function. It's an optional final argument which dictates whether Vlookup
should return only an exact match, or the largest number which is smaller
than the number being sought. If the Range_Lookup argument is FALSE, an exact
match is required. If TRUE or omitted, the closest match is returned.

Regards,

Hutch

"masterbaker" wrote:

Thanks Niek, that works.

Would you mind telling me how the hell that works??? Essentially it's
looking up a value that doesn't exist, so what is it actually looking up??

THanks a ton!!


"Niek Otten" wrote:

=VLOOKUP(B1-0.000000000001,A1:A5,1)

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"masterbaker" wrote in message ...
|I am looking for a way to utilize the max or maxa functions that returns a
| value depending on if it's less than a value. Assume:
|
| B1 value is 8
| A1:A5 values a
| 2
| 4
| 6
| 9
| 15
|
| I want a function that returns one of the values in A1:A5 that is the
| largest number less than B1. This example would return the value 6. I
| basically need a max function something like this:
|
| Max(A1:A5)<B1 (Return the maximum number of A1:A5 that's less than B1)
|
| This returns a false statement because the maximum number of A1:A5 is not
| less than B1, but I want the value of 6 to be returned because it is the
| largest number in the array that's less than B1. PLEASE HELP.
|
| Thanks in advance for anything from anyone!



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 947
Default max function with a less than or equal to

basically need a max function something like this:
Max(A1:A5)<B1


Here's an Array equation. (Ctlr+Shft+Enter)

=MAX(IF(A1:A5<B1,A1:A5))

--
HTH. :)
Dana DeLouis
Windows XP, Office 2003


"masterbaker" wrote in message
...
I am looking for a way to utilize the max or maxa functions that returns a
value depending on if it's less than a value. Assume:

B1 value is 8
A1:A5 values a
2
4
6
9
15

I want a function that returns one of the values in A1:A5 that is the
largest number less than B1. This example would return the value 6. I
basically need a max function something like this:

Max(A1:A5)<B1 (Return the maximum number of A1:A5 that's less than B1)

This returns a false statement because the maximum number of A1:A5 is not
less than B1, but I want the value of 6 to be returned because it is the
largest number in the array that's less than B1. PLEASE HELP.

Thanks in advance for anything from anyone!





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom functions calculating time arguments Help Desperate Bill_De Excel Worksheet Functions 12 April 25th 06 02:22 AM
How can I use Excel to solve an equation? titina Excel Worksheet Functions 4 April 11th 06 11:19 PM
clock Wildman Excel Worksheet Functions 2 April 26th 05 10:31 AM
Conversion SVC Excel Worksheet Functions 9 February 28th 05 02:29 PM
HOW CAN I GET OFFICE 2003 EXCEL BASIC TO NEST FUNCTIONS LIKE EXCE. Robert AS Excel Worksheet Functions 4 December 2nd 04 10:49 AM


All times are GMT +1. The time now is 07:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"