ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   LookUp If Greater Than and LessThan (https://www.excelbanter.com/excel-programming/440628-lookup-if-greater-than-lessthan.html)

LeeL

LookUp If Greater Than and LessThan
 
Trying to find a formula that will compare a number between 2 columns are
return the 3rd column

Something onlong the lines of
=If(And(NumberCol_A,Number<=Col_A),Col_c,"NotFoun d")

Col_A Col_B Col_C
20100101 20100129 JAN
20100129 20100226 FEB
20100226 20100402 MAR

so if Number='2010304' the result is 'MAR'
--
Thanks & Best Regards

Mike H

LookUp If Greater Than and LessThan
 
Hi,

The example llokup value you gave doesn't match any of the criteria so I'll
guess that's a typo. Try this ARRAY formula with the lookup value in D1

=INDEX(C1:C10,MATCH(1,(A1:A10<=D1)*(B1:B10D1),0))

This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"LeeL" wrote:

Trying to find a formula that will compare a number between 2 columns are
return the 3rd column

Something onlong the lines of
=If(And(NumberCol_A,Number<=Col_A),Col_c,"NotFoun d")

Col_A Col_B Col_C
20100101 20100129 JAN
20100129 20100226 FEB
20100226 20100402 MAR

so if Number='2010304' the result is 'MAR'
--
Thanks & Best Regards



All times are GMT +1. The time now is 02:17 AM.

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