[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Need a vlookup / index excel formula

Posted on 2015-01-18
9
Medium Priority
?
90 Views
Last Modified: 2015-01-21
Hi All

I have an excel workbook with 17 Sheets.

On each sheet Column "A" list of names, Column "B" has a value that varies.

On some days there are more names in Column "A" than other days.

In the results Worksheet, I need to lookup the value in cell "A1" across all worksheets Column "A", then return the Maximum Value in Column "B" for that entry.

Any assistance would be greatly appreciated!

Thanks
David
0
Comment
Question by:tenacityit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 23

Expert Comment

by:Michael Fowler
ID: 40556818
I not sure I am getting your question

So the Max value for cell B1 across sheets 1 to 17 or will there multiple instances of the name in column A which need to be accounted for

The following example covers 5 sheets and just needs to be expanded if it is just the MAX of column B across the sheets

=MAX(Sheet1!B1,Sheet2!B1,Sheet3!B1,Sheet4!B1,Sheet5!B1)

Open in new window


If I have missed the point could you please post an example workbook with some dummy data
0
 

Author Comment

by:tenacityit
ID: 40556835
Thanks for your reply.

The name in Column A could appear multiple times or not at all across the worksheets.

It needs to lookup the name from the master list of names located in Column A on the results worksheet.

I hope that helps.

Thanks
David
0
 

Author Comment

by:tenacityit
ID: 40556949
Worksheet 1

Column A       Column B
john                 113
Paul                 121
Sarah               225
Shaun             126
Greg                99
Mary                897

Worksheet 2

Column A       Column B
Greg                 222
Michael            121
Sarah               565
Shaun             836
john                 199
Mary                347



Results Worksheet

Column A      Column B
John              (Result)
Michael      (Result)
Sarah           (Result)
Greg            (Result)
Shaun          (Result)
Mary            (Result)
Paul             (Result)

As you can see in Worksheet 1 there is no user Michael and Worksheet 2 there is no user Paul.

What I need is to search for Name based on the list in the Results Worksheet, and then return the Max Value in Column B to the results worksheet.

Does that clarify?

Thanks
David
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 23

Expert Comment

by:Michael Fowler
ID: 40556975
Here is a VBA script that performs this for you. It assumes sheets named Sheet1 to Sheet17 for the data and one named Results. This can be tweaked as required

Sub results()
    Dim resultsSht As Worksheet, currSht As Worksheet
    Dim resultsLastRow As Long, currShtLastRow As Long, shtNum As Long, currMax As Long, i As Long
    Dim loc As Range, firstLoc As Range
    
    Set resultsSht = Worksheets("Results")
    resultsLastRow = resultsSht.Range("A" & Rows.Count).End(xlUp).Row
    
    
    For i = 1 To resultsLastRow
        currMax = 0
        For shtNum = 1 To 17
            Set currSht = Worksheets("Sheet" & shtNum)
            currShtLastRow = currSht.Range("A" & Rows.Count).End(xlUp).Row
            With currSht.UsedRange
                Set loc = .Cells.Find(What:=resultsSht.Range("A" & i).Value)
                If Not loc Is Nothing Then
                    Set firstLoc = loc
                    Do
                        currMax = loc.Offset(0, 1).Value
                        Set loc = .FindNext(loc)
                    Loop While Not loc Is Nothing And loc <> firstLoc
                End If
            End With
            Set loc = Nothing
        Next
        resultsSht.Range("B" & i).Value = currMax
    Next
    
End Sub

Open in new window


The attached working example only has two sheets and so the script has been edited to allow for this
Book1.xlsm
0
 
LVL 8

Accepted Solution

by:
Naresh Patel earned 2000 total points
ID: 40557089
May be this will help you ...see attached .....you have to add sheets in which you want to find lookup or max or sum between sheet "Start - Finish".

See attached.

Thanks
3D-Functions.xlsm
0
 

Author Comment

by:tenacityit
ID: 40558631
Thanks for the replies.

itjockey, You're on the right track, however the Name won't be in the same cell on each worksheet. It needs to lookup the name first in Column A. and you can't sort the column alphabetically as there will be more names on some sheets than others.

Thanks
David
0
 
LVL 8

Expert Comment

by:Naresh Patel
ID: 40558664
You just add names in any order .....it will return to max value of that name in sheets between Start to Finish.
0
 
LVL 8

Expert Comment

by:Naresh Patel
ID: 40558690
Why you want to sort or lookup names ...it is excel formula which search for particular name on each sheets in column A between Start - Finish sheets and returns to max value of that particular name across the sheet.Beauty of this set up is you add sheet between Start - Finish and you will see change in main sheet.

Thanks
0
 

Author Closing Comment

by:tenacityit
ID: 40563598
Great solution, worked perfectly
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question