Link to home
Start Free TrialLog in
Avatar of fabi2004
fabi2004Flag for United States of America

asked on

Help with Excel formula to look up text in multiple columns then retrieve a value with a formula from another column.

Can someone please help me with a formula?  I'll try to verbalize what I need to do, although sometimes it's hard to be clear when spelling it out.

In a workbook with multiple sheets, there is info on sheet 1 that I need to match/look up using info from sheet 2.  If I find a match in 1 or more of the 3 columns of sheet 1 - on the same row - then I need to retrieve and manipulate the value from another column in sheet 1 and place it on sheet 2.

I'm attaching a sample worksheet.  Below is what I wrote on sheet 2, column B.  I hope this makes sense.

"If Name is found in Sheet 1 column A, or B or C, then place the sheet 1 column D amount divided by 3 here, else if the Name is found in two of the three columns (same row), sheet 1 column A,B, C, then place the sheet 1 column D amount times 2/3 here, else if Name is found in all three columns (same row) of Sheet 1 columns A, B, C, then place the full amount of D here."

I've been trying combinations of Ifs, nested if, with vloouup or with index/match but I haven't hit on the right combination that makes this work.

Thanks in advance for your help!
Avatar of Shums Faruk
Shums Faruk
Flag of India image

No attachment?
Avatar of fabi2004


ack!  sorry!  Here it is.
oh no...I need to clarify something else...

the "name" might appear more than once in any of the three columns of sheet 1.  If so, then the amounts should be added (after they are calculated as times 1/3 or 2/3 or full amount).

I tried something manual (of course with formula).

For eg: Gabe appeared in all three columns in 2nd row. Amount 1 should be 1000 plus, he/she appeared once in Col B & 2nd Row, from 1500/3=500. Gabe's total for Amount 1 should be 1500.
Same way for Amount 2, he/she appeared in all three columns in 2nd row. Amount 2 should be 2000 plus, he/she appeared once in Col B  & 2nd Row, from 2500/3=833.33. Gabe's total for Amount 2 should be 2833.33
Like wise I did for all the names, but Total is not distributing evenly.
Please check sample.
Please find attached Manual working in Sheet1 & Formulated in Sheet2 (with helper columns in Sheet1)
Hi Shums,  thank you for all this work.

I hate to ask more questions, but I've been staring at it for almost an hour and can't be sure I understand.

1.  Will this expand out to greater number of names and greater number of rows?  For example, what if there were 15 different names and 300 rows?

2.  I need to minimize any changes/additions we make to sheet 1.  I might get away with an extra hidden column or two, but I'd rather add the helper columns to sheet 2 if at all possible.  So, if I try to move your additional columns from sheet 1 to sheet 2, do I have to add a row to sheet two for each row in sheet 1?

3.  Do we need the count/average columns?  The amounts are always going to be divided by 3 and then multiplied by then number of times a name appears in columns A, B or C.  I need to keep a running total of each amount for each person but I won't necessarily know how many times that persons name appears in sheet 1 so I can't simply use rows to track that running total.  How would I take that into account?  On this example it was a straightforward 3 rows for each person.
Avatar of Shums Faruk
Shums Faruk
Flag of India image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That's fantastic.  Thank you so much for all of your help.  I was afraid I wasn't explaining my questions well but you figured out exactly that was needed to make this work.  I very much appreciate your time and your help.
You're Welcome! Glad I was able to help.