search a value in a range how to?

jamiguel77

Active Member
Joined
Feb 14, 2006
Messages
387
Office Version
  1. 2016
  2. 2010
  3. 2007
Platform
  1. Windows
  2. Web
A B C
1 1 4 76.5
2 5 7 80.5
3 8 12 92.3
4 13 1000 145.67


if the user type in the cell D1: 3 the result in D2 would be: 76.5
if the user type in the cell D1: 4 the result in D2 would be: 76.5
if the user type in the cell D1: 9 the result in D2 would be: 92.3

the maximum number of ranges can be 1000(i want a solution that is scalable)

i try with if (but not like me)

Thanks
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Try using LOOKUP:

<b>Excel 2003</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th><th>D</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style="text-align: right;;">1</td><td style="text-align: right;;">4</td><td style="text-align: right;;">76.5</td><td style="text-align: right;;">5</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style="text-align: right;;">5</td><td style="text-align: right;;">7</td><td style="text-align: right;;">80.5</td><td style="text-align: right;;">80.5</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style="text-align: right;;">8</td><td style="text-align: right;;">12</td><td style="text-align: right;;">92.3</td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style="text-align: right;;">13</td><td style="text-align: right;;">1000</td><td style="text-align: right;;">145.67</td><td style="text-align: right;;"></td></tr></tbody></table><table cellpadding="2.5px" rules="all" style=";background-color: #E0E0F0;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style="background-color: #E0E0F0;text-align: center;color: #161120"><th><b>Sheet1</b></th></tr></td></thead></table><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">D2</th><td style="text-align:left">=LOOKUP(<font color="Blue">D1,A1:A4,C1:C4</font>)</td></tr></tbody></table></td></tr></table><br />

Also, you can eliminate column B altogether with this formula.
 
Upvote 0
tested and workd
only 2 things:

=BUSCAR(D1,A1:A4,C1:C4)

if in cell D1 i type a 0 or -1 i get a #N/A <--- how to personalize the message? same as: "ERROR te valu would be grater or equal tan 1"


if in cell D1 i type a 1001 or a more big number i get always 145.67 how to solve this dispalying a personal message?

thanks

i am tested this complicated function:


if can check my book downloading here:

http://www.filedropper.com/range-lookup-formula-example2


=SI(SUMAPRODUCTO(--(B6:B15<=C3)*(C6:C15>=C3))=1,"=D"&SUMAPRODUCTO(--(B6:B15<=C3)*(C6:C15>=C3),FILA(B6:B15)),"Not Found")


the problem is, in cell C4 (the result) i get =D12 or =D6 but never the value of the cell D12

thanks
 
Upvote 0
Give this a shot:

<b>Excel 2003</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><colgroup><col width="25px" style="background-color: #E0E0F0" /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: #E0E0F0;text-align: center;color: #161120"><th></th><th>A</th><th>B</th><th>C</th><th>D</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style="text-align: right;;">1</td><td style="text-align: right;;">4</td><td style="text-align: right;;">76.5</td><td style="text-align: right;;">5</td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style="text-align: right;;">5</td><td style="text-align: right;;">7</td><td style="text-align: right;;">80.5</td><td style="text-align: right;;">80.5</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style="text-align: right;;">8</td><td style="text-align: right;;">12</td><td style="text-align: right;;">92.3</td><td style="text-align: right;;"></td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style="text-align: right;;">13</td><td style="text-align: right;;">1000</td><td style="text-align: right;;">145.67</td><td style="text-align: right;;"></td></tr></tbody></table><table cellpadding="2.5px" rules="all" style=";background-color: #E0E0F0;border: 1px solid;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style="background-color: #E0E0F0;text-align: center;color: #161120"><th><b>Sheet1</b></th></tr></td></thead></table><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #A6AAB6"><thead><tr style=" background-color: #E0E0F0;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #E0E0F0;color: #161120">D2</th><td style="text-align:left">=IF(<font color="Blue">D1<1,"ERROR te valu would be grater or equal tan 1",IF(<font color="Red">D1>1000,"ERROR te valu would be less or equal tan 1000",LOOKUP(<font color="Green">D1,A1:A4,C1:C4</font>)</font>)</font>)</td></tr></tbody></table></td></tr></table><br />

And unfortunately, my workplace blocks file downloading, so I cannot download and look at your workbook.
 
Upvote 0
Done with Vlookup

can you see my file?

open new thread?

Thanks
 
Upvote 0

Forum statistics

Threads
1,224,616
Messages
6,179,909
Members
452,949
Latest member
beartooth91

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top