Search Multiple Columns for One Value

jvought

New Member
Joined
Jun 27, 2023
Messages
10
Office Version
  1. 2019
Platform
  1. Windows
Excel Version 2019

I belong to an organization that sell tickets for fundraising. Each ticket has two numbers printed on it. The first number is between 000 and 499 and the second number is a random number between 500 and 999.

I've created a sheet (TicketList) that sorts the tickets in column A containing numbers 000 through 499, column B containing the random number between 500 and 999, column C containing the ticket purchaser's name, and column D containing the purchaser's phone number.

The winning numbers are determined by to evening state lottery. On another sheet (Winners), I have the column A with days of the month. I'd like to be able to enter the winning number in column B and perform a search in TicketList columns A and B to have the winner's name and address automatically fill in columns C and D. I have tried this using index/match but it doesn't seem to work.

=INDEX(TicketList!A6:D505,MATCH(B5,TicketList!A6:B505,0),3) to get the winner's name in Winners!C5
=INDEX(TicketList!A6:D505,MATCH(B5,TicketList!A6:B505,0),4) to get the winner's phone number in Winners!D5

I'm also not sure if the numbers in both sheets have to be in a particular format. If I use anything except Text for a format, leading zeros are truncated. Everything I have tried gives me #N/A.

Is there anything obvious I'm missing with this?
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Hi & welcome to MrExcel.
Try
Excel Formula:
=iferror(INDEX(TicketList!C6:C505,MATCH(B5,TicketList!A6:A505,0)),INDEX(TicketList!C6:C505,MATCH(B5,TicketList!B6:B505,0)))
 
Upvote 0
Solution
Thanks for getting back to me. I get a Value Not Available error when I tried this.
 
Upvote 0
What do you mean by "A value not available"?
 
Upvote 0
I got this error so I created a new mini-workbook from scratch and still got the error.

Here is the new sheet-

1687886787184.jpeg

Here is the error I get-

1687886821288.jpeg
 
Upvote 0
Make sure that the value in B2 is text & not a number.
 
Upvote 0
Ok, you also need to change the formula the way I showed, you still have multiple columns for the index & not one.
 
Upvote 0
1687890336866.png

I'm now getting this result when I enter 000 - 003. When I enter 004, 005, or any number from column B I get this...

However, when I enter 763 I get this...
1687890541008.png
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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