Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lookup multiple values in Excel

Status
Not open for further replies.

OilBoiler

Chemical
Aug 5, 2003
43
Hi everyone,

This is what I've been trying to do with an Excel Spreadsheet.

For the sake of this example, this is the model of my spreadsheet:

Column A contains categories such as "Pumps, compressors, etc..."
Column B contains costs for the different equipment.

I want to create an additional table where I can have a heading that says "Pumps" for instance, and have a formula that would look up values in Column A referencing to the text "Pumps" and go to the next column "B" and look up the corresponding value.

This is easily done with LOOKUP and other formulas, but in my case I have column A with several "Pump" entries, so I want more than just the value of the first row that has that text.

Does that make sense? I did research on the Microsoft website and they provided SMALL, INDEX, ISERROR formulas combined with each other, but it didn't work for me, even though I copied and pasted the example they had on their website and followed it.

This is a link to the site, which may exlan better what I want to achieve:


Any insights??

Thanks!
 
Replies continue below

Recommended for you

If you want "more than just the value of the first row that has that text", then what do you want to do with the multiple results? Do you want to sum them (in which case you can use SUMIF, for example)?
 
Say I have two columns of date. In cells A1 to A10 I have labels like "pump", "compressor", etc and in adjacent cells B1 to B10 I have costs. There may be several entries for "pump" in column A, each with its own cost.

If I want to find out the total cost of all "pump" entries, I can put this formula in cell C1:

=SUMIF(A1:A10,"pump",B1:B10)
Alternatively, I can put the word "pump" in cell C1 and put the following formula in cell D1:
=SUMIF(A1:A10,C1,B1:B10)
Furthermore, I can then also put the word "compressor" in cell C2 and put the following formula in cell D2:
=SUMIF(A1:A10,C2,B1:B10)

Hopefully you'll try this and then see a pattern that is of use to you...

Brian


 
Is it not something you could do using pivot table?
 
I think both pivot table and Brian's approach (sumif) would work.

sumif has the advantage that it doesn't need to be manually recalculated if you change the data.

=====================================
Eng-tips forums: The best place on the web for engineering discussions.
 
Yes, the SUMIF works great. I didn't know about array formulas. Thank you so much!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor