Formulas Shortening

DailyCaffeine

New Member
Joined
Feb 9, 2022
Messages
25
Office Version
  1. 365
Platform
  1. Windows
Good afternoon,

I was wondering if someone could help me shorten or change my formula to something easier to understand?
=SUMPRODUCT(('Tab 2'!$E$6:$P$6=$A$4)*('Tab 2'!$D$8:$D$135=$A11)*('Tab 2!$E$8:$P$135))

Tab 2 contains a list of products that needs to be sorted in Tab 1.
The formula first checks which column in Tab 2 E6:P6 have the same month in Tab 1 A4
It then checks which rows in Tab 2 D have the same category as Tab 1 A11
Finally, it combines all of the values with the same month and category in a cell in Tab 1


Tab 2 looks as below
ABCDEFG
------------CategoryApril 2022May 2022June 2022
------------Enhanced Services100020003000


Tab 1 looks as below
April 2022
AB
CategoryTotal
Enhanced Services1000
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
I doubt you will get anything shorter than that. And as for easier to understand, that's very subjective & we don't know your knowledge level.
That said I don't think you will get anything "simpler"
 
Upvote 0
I put a couple of images to be clearer the explanation
The first image is tab 2. The values in red, in this example, will be added:

1675091859466.png



This minisheet is Tab 1:
Dante Amor
AB
1
2
3
4April 2022
10CategoryTotal
11Enhanced Services5,415
Tab 1
Cell Formulas
RangeFormula
B11B11=SUMIF('Tab 2'!$D$8:$D$135,A11,INDEX('Tab 2'!$E$8:$P$135,0,MATCH($A$4,'Tab 2'!$E$6:$P$6,0)))



This part corresponds to the categories in column D that are equal to the value in cell D11:
!$D$8:$D$135,A11

This part corresponds to the sum range, but it only considers the column that matches the month, the column search is the range E6 to P6 and must match the value of A4:
INDEX('Tab 2'!$E$8:$P$135,0,MATCH($A$4,'Tab 2'!$E$6:$P$6,0)))

----- --
NOTE XL2BB:
For the future, it would help greatly if you could give us the sample data in a form that we can copy to test with.
MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in
Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
----- --
 

Attachments

  • 1675091364255.png
    1675091364255.png
    25.6 KB · Views: 4
Last edited:
Upvote 0

Forum statistics

Threads
1,214,793
Messages
6,121,614
Members
449,039
Latest member
Mbone Mathonsi

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