finding row number and then color it.

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,805
Office Version
  1. 2016
Platform
  1. Windows
Hi
I have 2 columns, one has names and second has phone number. I will use Vlookup() to return the phone number if a user enter the name. That I can do but what else I want to do is to return the row number of that name and also Highlight the row corresponding to that name with different color. How can I do that? not the vlookup() part but for the finding row number and coloring the row. thanks you
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Instead of using VLOOKUP, get in the habit of using INDEX(MATCH)

VLOOKUP is prone to errors which can be extremely hard to spot, e.g. if you insert a column. It also looks only one way, i.e. you look at column 1 and then return the value from column X. INDEX(MATCH) can look at any column and return the value from any other column

In your case you would replace e.g.
=VLOOKUP(A11,A1:A10,2,false)
with
=INDEX(B1:B10,MATCH(A11,A1:A10,0))

This also answers your questions, as the row number is found by the MATCH part of the formula, and you can use this value within Conditional Formatting
 
Upvote 0

Forum statistics

Threads
1,214,630
Messages
6,120,634
Members
448,973
Latest member
ChristineC

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