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

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
=IFERROR(INDEX(TicketList!A2:A6,MATCH(B2,TicketList!A2:A5,0)),INDEX(TicketList!A2:A6,MATCH(B2,TicketList!A2:D5,0)))
 
Upvote 0
You are indexing the wrong column. Look at what I suggested.
 
Upvote 0
I fixed that part. is there a place that I should have a ,3 in the formula to return a name?

=IFERROR(INDEX(TicketList!A2:A6,MATCH(B2,TicketList!A2:A5,0)),INDEX(TicketList!A2:A6,MATCH(B2,TicketList!B2:B5,0)))
 
Upvote 0
You are still indexing the wrong column. If you look at the formula I posted you will see that.
 
Upvote 0
I changed the index and it worked.

=IFERROR(INDEX(TicketList!C2:C5,MATCH(B2,TicketList!A2:A5,0)),INDEX(TicketList!C2:C5,MATCH(B2,TicketList!B2:B5,30)))

Thank you for all your help!
 
Upvote 0
Glad to help & thanks for the feedback.
 
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