04-09-2021, 12:02 PM | #1 | ||
College Benchwarmer
Join Date: Oct 2009
Location: Austin, TX
|
PING: Excel Gurus
I'd like a cell to automatically update the name of a person, based on a budget that's typed in a cell
For example: Cell A1 is budget ZZ123-456 That budget belongs to Lorena Marks I would like cell B1 to automatically update with Lorena Marks Cell A2 is budget ZZ789-000 That budget belongs to Matt Damon I would like B2 to automatically update with Matt Damon We have a whole bunch names attached to different budgets, and having to type these long list of names is daunting. There's a separate tab where were pulling all this information from. Hope it makes sense Thanks!
__________________
DON'T ITCH THAT NOSE! A Meditation Dynasty |
||
04-09-2021, 12:13 PM | #2 |
Grizzled Veteran
Join Date: Nov 2013
|
__________________
"I am God's prophet, and I need an attorney" |
04-09-2021, 01:20 PM | #3 |
n00b
Join Date: Mar 2017
|
VLOOKUP works, but INDEX MATCH is more dynamic... With VLOOKUP, if you insert a column in between the start of your table and the column you want to reference, your formula will break (the column_index_number within your VLOOKUP won't update). INDEX MATCH, on the other hand, safely updates no matter where you insert columns.
|
04-09-2021, 01:58 PM | #4 |
College Prospect
Join Date: Dec 2002
|
Do you have MS Access? It seems like it would be a lot easier to make a query for this.
|
04-09-2021, 02:19 PM | #5 | |
College Benchwarmer
Join Date: Oct 2009
Location: Austin, TX
|
Quote:
Sadly no
__________________
DON'T ITCH THAT NOSE! A Meditation Dynasty |
|
04-09-2021, 02:36 PM | #6 | |
College Benchwarmer
Join Date: Oct 2009
Location: Austin, TX
|
Quote:
Hey, it totally worked! Took me a bit, but yes, that's it exactly. My entire department owes me lunch haha. Thanks so much!
__________________
DON'T ITCH THAT NOSE! A Meditation Dynasty |
|
04-09-2021, 05:19 PM | #7 |
College Benchwarmer
Join Date: Oct 2009
Location: Austin, TX
|
Okay, I lied, it didn't work.
=VLOOKUP(D147,'PT Contact List.03312021'!A2:C94,2,FALSE) =VLOOKUP(D148,'PT Contact List.03312021'!A3:C95,2,FALSE) I copied the formula, but I need the bold part to stay the same - A2:C94 Halp 😒
__________________
DON'T ITCH THAT NOSE! A Meditation Dynasty |
04-09-2021, 05:33 PM | #8 | |
Grizzled Veteran
Join Date: Nov 2013
|
Quote:
Instead of "A2:C94", use "$A$2:$C$94"
__________________
"I am God's prophet, and I need an attorney" |
|
04-09-2021, 06:04 PM | #9 |
College Benchwarmer
Join Date: Aug 2005
Location: Canada
|
|
04-10-2021, 09:24 AM | #10 | |
College Prospect
Join Date: Nov 2006
Location: High and outside
|
Quote:
F4 cycles through, so hitting it once gives you $A$2:$C$94. A second time gives you $A2:$C94, "locking" the columns. A third time gives you A$2:C$94, "locking" the rows. Well, I'm not sure that's the right order but multiple F4s cycle through your options. Secondly, I'm with joe in that the cool kids use INDEX-MATCH. It's more powerful and robust. In your case, it would be something like =INDEX($B$2:$B$94,MATCH(D147,$A$2:$A$94)) . From inside out, it means MATCH the contents of D147 with the source stuff in $A$2:$A$94 and secretly count how far down you had to go. Now, (with INDEX) count down that many in the return stuff in $B$2:$B$94 and give me that value. You don't have to have the columns side-by-side nor even in the same rows nor even on the same sheet nor in column form (but it gets tricky -- you have to figure out how it does the counting). And, if anyone inserts and moves stuff, it still works fine. You have to do something clever with your column number if you use VLOOKUP to get that robustness. |
|
04-10-2021, 11:15 AM | #11 |
Pro Starter
Join Date: Sep 2009
Location: Somewhere More Familiar
|
Index - Match is amazing. It's a little wonky to get your head around the first few times, but once you have it, it's incredible.
That first range of cells is the data you are looking for - what you want to show up when you're done. The individual cell reference is what you're looking up to find it. The second range of cells is where your key data value you are looking up is. |
04-10-2021, 11:27 AM | #12 |
Pro Starter
Join Date: Sep 2009
Location: Somewhere More Familiar
|
In your case, you have a table somewhere with both Budget and the name of who it belongs to. And you have a separate list with just the budget. So your three values in the cell:
=Index([range of names in table],match(A1,[range of budgets in table],0) If you put this formula in cell B1 on the tab where your list of budgets is that needs names, then use those $ to make the range for names and budgets an absolute reference, you can copy the formula down to each row in your list and it will work. |
04-10-2021, 08:52 PM | #13 | |
College Benchwarmer
Join Date: Aug 2005
Location: Canada
|
Quote:
Yeah, I thought of mentioning this. I didn't want it to get too confusing. Agree with everyone else though about INDEX-MATCH. I mean, VLOOKUP is okay for what it is, but it only goes one direction. INDEX-MATCH is much more powerful and overall a better skill to have familiarity with. |
|
04-10-2021, 11:28 PM | #14 |
College Prospect
Join Date: Jul 2001
Location: Newcastle, Australia
|
I haven't gotten around to using it myself yet but I thought that XLOOKUP is the new preferred option for these sorts of things.
XLOOKUP function - Office Support |
04-11-2021, 12:32 AM | #15 |
Pro Starter
Join Date: Sep 2009
Location: Somewhere More Familiar
|
That's pretty slick. Index/match all in one, with a built in iferror for fun. That'll make a lot of my formulas way cleaner.
|
04-15-2021, 01:30 PM | #16 |
College Starter
Join Date: Oct 2000
Location: Pittsburgh, PA
|
I just used xlookup for the first time. I had my lookup value in Column D and the value I needed was in column B. With vlookup, i would have to copy my lookup column and now I just set each column as the lookup and return array and it worked perfectly.
__________________
"It's a great day for hockey" - "Badger" Bob Johnson |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
|
|