filter and transpose non empty cells

ExcelNewbie2020

Active Member
Joined
Dec 3, 2020
Messages
293
Office Version
  1. 365
Platform
  1. Windows
i have this data below,

if i search the TAG #, its information will get filtered and will rearrange from single rows to 3 columns (including the column header) and ignored empty cells. please see the expected result. many thanks


Book4
ABCDEFGHI
1RAW DATA
2TAG #DOGQTYCATQTYMOUSEQTYHORSEQTY
310032100006500082500
410041020000122000014200001620000
51005203000022300002430000
6
7
8
9
10
11
12
13
14EXPECTED RESULT
15
16TAG #
171003DOG210000
18MOUSE62500
19HORSE82500
20
Sheet5
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
How about
Fluff.xlsm
ABCDEFGHI
1RAW DATA
2TAG #DOGQTYCATQTYMOUSEQTYHORSEQTY
310032100006500082500
410041020000122000014200001620000
51005203000022300002430000
6
7
8
9
10
11
12
13
14EXPECTED RESULT
15
16TAG #
171003DOG210000
18MOUSE65000
19HORSE82500
Data
Cell Formulas
RangeFormula
B17:D19B17=LET(f,FILTER(B3:I5,A3:A5=A17),HSTACK(TOCOL(CHOOSECOLS(IF(f<>"",B2:I2,1/0),1,3,5,7),2,),WRAPROWS(TOCOL(f,1),2)))
Dynamic array formulas.
 
Upvote 1
If they contain 0 why did you say to ignore empty cells?
 
Upvote 0
If they contain 0 why did you say to ignore empty cells?
yes my bad.. first i thought only empty cells need to be ignored. when i run the formula to my actual data, there are zero values and is not good in the eyes
 
Upvote 0
Try
Excel Formula:
=LET(f,FILTER(B3:I5,A3:A5=A17),HSTACK(TOCOL(CHOOSECOLS(IF(f<>0,B2:I2,1/0),1,3,5,7),2,),WRAPROWS(TOCOL(IF(f<>0,f,1/0),2),2)))
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,465
Messages
6,124,977
Members
449,200
Latest member
Jamil ahmed

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