Excluding non zero values using the filter function

bearcub

Well-known Member
Joined
May 18, 2005
Messages
732
Office Version
  1. 365
  2. 2013
  3. 2010
  4. 2007
Platform
  1. Windows
I need to create a separate sheet for payroll by country based off of a payroll sheet. I am using the Filter function to this.
FILTER(FILTER('Comm_Sept 22 Intl Summary'!D4:N73,'Comm_Sept 22 Intl Summary'!D4:D73= A2),{0,1,1,0,0,0,0,0,0,1,1})

1) Is there a more efficient way to write this formula? In my criteria range, I only want the 2,3,9 & 10th columns.
2) How do I exclude reps who don't have commissions. Right now, it will pull everyone on the summary sheet that is based upon the country criteria
3) Is there a way to create a dynamic sum range based upon what is spilled from the list. The range will vary from month to month and I will like to create a total at the end of the list dynamically.

Here is an example of what I have presently based upon my formula. The Total was manually added, is there a way to make this dynamic based upon current employees being paid

Country Name DeptTotal PaymentCur
GERMANY Marc Ackermann (ZHGKQG5VN) 4050007,500.00 EUR
GERMANY Max Kleemann (6GXPEMSCY) 4050007,500.00 EUR
GERMANY Roy Schultheiss (LN8ZWI2KV) 40500098,481.34 EUR
GERMANY Sirko Schoeder (7KAXF29MO) 4050007,500.00 EUR
GERMANY Emel Rehberg (BPV7QDR90) 4050000.00
GERMANY Zoran Duvnjak (BORGUWVSV) 4100002,550.45 EUR
GERMANY Tatjana Wild (V02AD8W51) 4300006,545.47 EUR
Total130,077.26
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Do you have functions such as Expand & ChooseCols yet?
 
Upvote 0
Yes, I work for a company that is running 365
 
Upvote 0
I seem to have most of the new array functions
 
Upvote 0
Ok, how about
Excel Formula:
=LET(a,CHOOSECOLS(FILTER('Comm_Sept 22 Intl Summary'!D4:N73,('Comm_Sept 22 Intl Summary'!D4:D73= A2)*('Comm_Sept 22 Intl Summary'!M4:M73<>0)),2,3,10,11),SUBSTITUTE(VSTACK(a,{"","Total","~#",""}),"~#",SUM(INDEX(a,,3))))
 
Upvote 0
Wow, really cool. What I noticed is that I can't format the currency column. Excel is formatting everything as text. How do I get around that? How could I add the Text function to column 10 to format it as currency?
 
Upvote 0
Ok, how about
Excel Formula:
=LET(a,CHOOSECOLS(FILTER('Comm_Sept 22 Intl Summary'!D4:N73,('Comm_Sept 22 Intl Summary'!D4:D73= A2)*('Comm_Sept 22 Intl Summary'!M4:M73<>0)),2,3,10,11),VSTACK(a,CHOOSE({1,2,3,4},"","Total",SUM(INDEX(a,,3)),"")))
 
Upvote 0
This is what I presently see when I use the formula. I would like to have column D ("Total Payment") formatted to number format if possible:

Country Name DeptTotal PaymentCur
GERMANY Marc Ackermann (ZHGKQG5VN)4050007500EUR
GERMANY Max Kleemann (6GXPEMSCY)4050007500EUR
GERMANY Roy Schultheiss (LN8ZWI2KV)40500098481.3431EUR
GERMANY Sirko Schoeder (7KAXF29MO)4050007500EUR
GERMANY Zoran Duvnjak (BORGUWVSV)4100002550.44516EUR
GERMANY Tatjana Wild (V02AD8W51)4300006545.47EUR
Total130077.25826
 
Upvote 0
In that case just format the column to whatever you need.
 
Upvote 0
I've tried to format Column D but am able to do so. I was able to format the total value but am trying to figure out how to format the individual payees.

This the formula I'm presently using:

LET(a,CHOOSECOLS(FILTER('Comm_Sept 22 Intl Summary'!D4:N73,('Comm_Sept 22 Intl Summary'!D4:D73=A2)*('Comm_Sept 22 Intl Summary'!M4:M73<>0)),2,3,10,11),SUBSTITUTE(VSTACK(a,{"","Total","~#",""}),"~#",TEXT(SUM(INDEX(a,,3)),"###,###.00")))

Compensation Summary Int'l Oct 22 - September 22 Commission Payments.xlsb
ABCDE
1 Country Name DeptTotal PaymentCur
2 GERMANY Marc Ackermann (ZHGKQG5VN)4050007500EUR
3 GERMANY Max Kleemann (6GXPEMSCY)4050007500EUR
4 GERMANY Roy Schultheiss (LN8ZWI2KV)40500098481.3431EUR
5 GERMANY Sirko Schoeder (7KAXF29MO)4050007500EUR
6 GERMANY Zoran Duvnjak (BORGUWVSV)4100002550.44516EUR
7 GERMANY Tatjana Wild (V02AD8W51)4300006545.47EUR
8Total130,077.26
9
Germany
Cell Formulas
RangeFormula
B2:E8B2=LET(a,CHOOSECOLS(FILTER('Comm_Sept 22 Intl Summary'!D4:N73,('Comm_Sept 22 Intl Summary'!D4:D73=A2)*('Comm_Sept 22 Intl Summary'!M4:M73<>0)),2,3,10,11),SUBSTITUTE(VSTACK(a,{"","Total","~#",""}),"~#",TEXT(SUM(INDEX(a,,3)),"###,###.00")))
Dynamic array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E7:E8Expression=$K7 = "Draw"textNO
B6Cell ValueduplicatestextNO
E2:E3Expression=$K2 = "Draw"textNO
E4:E6,D2:D8Expression=$K2 = "Draw"textNO
D2:D8Expression=$B2 = "T"textNO
B4:B5Cell ValueduplicatestextNO
B6:B8,B2:B3Cell ValueduplicatestextNO
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,875
Members
452,363
Latest member
merico17

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