Search among multiple columns

srkreignz

New Member
Joined
Aug 22, 2014
Messages
27
Hi
I have a table in Sheet II

MonthVendorDieselWaterCleaner
JanXXX1000
JanXYZ1000
FebXYZ1000
FebYYY500
FebXYZ2000
MarchXXX1500

<tbody>
</tbody>

I want a report in Sheet I, when i choose a vendor from the dropdown list (which i have created), I want the sum of the respective item against each month.

Eg: I choose Vendor XYZ

Vendor: XYZ
MonthLoadItem
Jan1000Water
Feb3000Water
March0Water

<tbody>
</tbody>

Please help.
Thanks in advance
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Have you defined the item, or are you expecting the formula to pull in the item as well?

How would you expect it to look if the vendor had more than one item, or will this not occur?
 
Last edited:
Upvote 0
Have you defined the item, or are you expecting the formula to pull in the item as well? How would you expect it to look if the vendor had more than one item, or will this not occur?

Hi,

Since the 3 items are static, I have not defined it. It would be great if a formula can fetch the item.
On vendor part..a vendor cannot have more than one item.
 
Upvote 0
In terms of automatically pulling in the item based on the vendor selection (since each vendor only supplies 1 item) I would just create a reference table. Then you can use index(match to pull in the correct item based on the vendor selection. You'll see I created the vendor referencer in A9:B12. You can put this anywhere, you just need to modify the references to that range in my index(match formula in D16.

The formula which does the summing is an array formula, so when you put it into the function bar, you need to enter it by hitting CTRL+SHIFT+ENTER at the same time. After that you can drag it down.

Excel 2010
ABCDE
1MonthVendorDieselWaterCleaner
2JanXXX1000
3JanXYZ1000
4FebXYZ1000
5FebYYY500
6FebXYZ2000
7MarchXXX1500
8
9Define Vendor Item Here:
10XXXDiesel
11XYZWater
12YYYCleaner
13
14
15Report
16Choose VendorXXXVendor ItemDiesel
17
18MonthLoadItem
19Jan1000Diesel
20Feb0Diesel
21March1500Diesel

<tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
D16=INDEX($B$10:$B$12,MATCH($B$16,$A$10:$A$12,0))
C19=IF(A19<>"",$D$16,"")

<tbody>
</tbody>

<tbody>
</tbody>

Array Formulas
CellFormula
B19{=SUMPRODUCT(($A$2:$A$7&$B$2:$B$7=A19&$B$16)*($A$1:$R$1=$D$16),$A$2:$R$7)}

<tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>
 
Last edited:
Upvote 0
I am sure it can be done, but why not just put the reference table onto another sheet and then hide the sheet? This makes it a lot easier to manage in the long run anyways.
 
Upvote 0
:) I know its annoying for you ... but can u plz help me with the other solution where i can define the items??
 
Upvote 0
What do you mean by define the item? Manually type it in instead of having it come in from the reference table automatically? Or do you mean you want it to still come in by using a formula, but you don't want to have a reference table?

I can't really think of a way to do it without a reference table to be honest. Maybe someone else can.
 
Upvote 0
@Mick I was just trying my luck..

Got it done with ur solution...thanks a tonne for ur replies and ur patience :)
 
Upvote 0

Forum statistics

Threads
1,214,426
Messages
6,119,414
Members
448,895
Latest member
omarahmed1

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top