VBA/Formula needed for a complicated filter/data pull - Excel 365

justme101

Board Regular
Joined
Nov 18, 2017
Messages
67
Office Version
  1. 365
Platform
  1. Windows
Hello All,

I have one file where different products are listed in a column and along those rows, for each product, the type of pricing being offered is given for all the weeks of the year. Now, the pricing names can be varied, like discounted_1, discounted_2 etc. depending on what type of discount is being given. But, the thing which remains constant is that if there is no discount for a particular week, the words "Set price" appear for that week and product (it can be set price_1, or set price_2, but the words "set price" will be in that cell). A sample of the file is shown below (sorry my xls2bb is not working properly, so can't upload the file here).

Untitled.jpg


Now, the ask here is to get data for all these products (all unique line items) into a different sheet, with only the weeks where ANY kind of discount is given and the start date and end date as well from the top rows. It should look something like this.

Untitled2.jpg


I have tried all my *limited* knowledge of formulas and VBA to accomplish this, but I can't come up with something to solve it. If you can help me out to accomplish this, it would not be less than a miracle for me (It's that time of the year as well). Any formula, or VBA will work with me. Thank you, in anticipation.
 
How about
Excel Formula:
=LET(da,B4:D900,db,E1:P2,dc,E4:P900,c,COLUMNS(dc),s,SEQUENCE(c*ROWS(dc),,0),xa,INDEX(da,INT(s/c)+1,{1,2,3}),xb,INDEX(dc,INT(s/c)+1,MOD(s,c)+1),xx,CHOOSE({1,2,3,4,5,6},xa,xa,xa,xb,INDEX(db,1,MOD(s,c)+1),INDEX(db,2,MOD(s,c)+1)),FILTER(xx,(ISERR(SEARCH("set price",xb)))*(xb<>"")))
Fluff for the win!! Really appreciate it! Cheers. 🍻
 
Upvote 0

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,317
Members
449,081
Latest member
tanurai

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