Combining Subtotal, if, left right etc with filter

akenb

New Member
Joined
Dec 8, 2016
Messages
1
Hi,
I have a list of "Customers" in column A (A2-A270) in my first tab.
In columns B-G (listing "Item name" in B1-G1) I have listed a year slash a number: e.g. 2018/1000 (years ranging from 2017-2020.
What I want to do is to be able to form a table per customer in a secondtab depending on which customer is visible after filtering in my first tab.

Tab 1:
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]Item1
[/TD]
[TD]Item2
[/TD]
[TD]Item3
[/TD]
[/TR]
[TR]
[TD]Customer 1
[/TD]
[TD]2017/2000
[/TD]
[TD]2018/890
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Customer 2
[/TD]
[TD][/TD]
[TD]2020/8950
[/TD]
[TD]2017/780
[/TD]
[/TR]
[TR]
[TD]Customer 3
[/TD]
[TD]2018/5000
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


This table in tab2 I want to have like this:
Items on rows, years in columns and in the cells in between I want to list the number given in column B-G in my first tab.

Customer 1 chosen with filter in tab1 -->
Tab2:
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]2017
[/TD]
[TD]2018
[/TD]
[TD]2019
[/TD]
[TD]2020
[/TD]
[/TR]
[TR]
[TD]Item 1
[/TD]
[TD]2000
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Item 2
[/TD]
[TD][/TD]
[TD]890
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Item 3
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


I have the following formula but it doesn't take the filtering in tab 1 into consideration. How can I do this?
=IF(VALUE(LEFT(Tab1!B2;4))=Tab2!B1;VALUE(RIGHT(Tab1!B2;(LEN(Tab1!B2)-5)));0)
if
Tab1!B2= statement for item 1 customer 1
Tab2!B1= year in table in Tab2

I know you can use the formula subtotal for filtered values - but how do I integrate if, left, right formulas etc.?
It is okay that the table in Tab2 only works when there is only one customer visible in filter i Tab1.

Thank you.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

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