# Displaying text of first cell in a row based on another cell's value

#### Davezilla

##### New Member
I tried to find a simple answer to my question, but everything I found seems to be somewhat different from what I need. I have a worksheet showing payroll for each employee, and how much they worked each day of each week. Cell A of each row is the Week Ending date, followed by alternating hours worked and items processed each day of the week for Monday through Saturday. In cell Q of each row is a running total of the employee's wages for that week. Then, on every other line (U51 in my example), the value in cell U is a running total of the employee's wages for that pay period. This system is continued down the sheet, pay period after pay period. The '*' in cell R51 merely signifies that that week is a pay week.

In another part of the sheet (see my second image), I have shown the max and min values for the employee's list of biweekly payroll amounts. That much is easy.

What I want to do is, next to the values shown for the max and min payroll amounts, list the value in cell A for the row shown in the max or min cells. For example, if the employee's highest paycheck is in cell U51, I want to show the value in cell A51 next to the cell for the max value.

### Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

#### Eric W

##### MrExcel MVP
Welcome to the Board!

Book2 (version 1).xlsb
ABCDRSTU
45WE10252019*599.99
46
47WE11012019*718.55
48
49*654.88
50WE 12012019
51WE12082019*525.21
52
53
54
55Highest:718.55WE11012019
56Lowest:525.21WE12082019
Sheet5
Cell Formulas
RangeFormula
D55:D56D55=LOOKUP(2,1/(U\$1:U\$100=C55),A\$1:A\$100)

#### Davezilla

##### New Member
Thank you! You are wonderful! Of course, I changed the ranges to fit my worksheet, and it works perfectly!

Now I'm off to learn how the formula does what it does...

#### Eric W

##### MrExcel MVP
It's magic!

Seriously, let me know if you have questions, that one's short, but it's tricky! Glad I could help.

Replies
0
Views
177
Replies
5
Views
76
Replies
7
Views
454
Replies
1
Views
99
Replies
1
Views
255

1,127,832
Messages
5,627,152
Members
416,224
Latest member
RichardHell

### 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.

### Which adblocker are you using?

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

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