How do I make my excel spreadsheet take an un-organized column and group it into several small lists with a formula?

greyland

New Member
Joined
Dec 5, 2019
Messages
8
Office Version
  1. 2013
Platform
  1. Windows
So I'm trying to find a formula to make my Excel spreadsheet take a very un-ordered list(Column B), and sort of compress it into several ordered lists automatically.


Current Example Desired Outcome
A B A B
1: John - Apple 1: John - Apple
2: 2: - Orange
3: - Orange 3:
4: 4:
5: Nate 5: Nate - Apple
6: - Apple 6: - Orange
7: 7: - Berry
8: -Orange 8:
9: -Berry 9:


I need the things in Column A to stay where they are. And for column B to be ordered so that; from B1:B4 and B5:B9 etc. is in a list next to the A column values without spaces until the next list.

This is only one small piece of the whole spreadsheet and the cell locations and values are different than the example. And both of these columns are auto filled with formulas based on the rest of the spreadsheet, and data that is put in. If your interested the current formula in the B column looks like this: =IF(J3="","", IF(J3=0,D3, "")) That is how the info For Column B is generated. Now I just need it to order the information like the above example.

I also attached a picture of the portion of the actual spreadsheet i am trying to do this to if you would like to look at that for reference.

Any help would be greatly appreciated.
 

Attachments

  • Capture.PNG
    Capture.PNG
    99.1 KB · Views: 21

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
I cant edit the post but the examples I typed up did not post at all how I typed them, so its basicly useless. But the picture is there. And hopefully I explained myself well enough.
 
Upvote 0
Using VBA, could you have the blank rows removed
AND
The numbers in Column "L" filled in down the sheet ??
Would that help ?
 
Upvote 0
the current formula in the B column looks like this: =IF(J3="","", IF(J3=0,D3, ""))
See if this is any use. It involves using a different formula in column B.
I have used column K as a helper column but you could use any column off to the right (& hide it if preferred).
Each formula copied down.

Book1
ABCDEFGHIJK
1
2
3JohnAppleApple01
4Orange1
5 Orange01
6 1
7NateApplePear32
8Orange2
9BerryApple02
10 Grape12
11 Orange02
12 Berry02
13 2
14 2
No blanks
Cell Formulas
RangeFormula
B3:B14B3=IFERROR(INDEX(D:D,AGGREGATE(15,6,ROW(D$1:D$30)/((J$1:J$30&""="0")*(K$1:K$30=K3)),ROW()-LOOKUP("ZZZ",A$1:A3,ROW(A$1:A3))+1)),"")
K3:K14K3=K2+(A3<>"")
 
Upvote 0
See if this is any use. It involves using a different formula in column B.
I have used column K as a helper column but you could use any column off to the right (& hide it if preferred).
Each formula copied down.

Book1
ABCDEFGHIJK
1
2
3JohnAppleApple01
4Orange1
5 Orange01
6 1
7NateApplePear32
8Orange2
9BerryApple02
10 Grape12
11 Orange02
12 Berry02
13 2
14 2
No blanks
Cell Formulas
RangeFormula
B3:B14B3=IFERROR(INDEX(D:D,AGGREGATE(15,6,ROW(D$1:D$30)/((J$1:J$30&""="0")*(K$1:K$30=K3)),ROW()-LOOKUP("ZZZ",A$1:A3,ROW(A$1:A3))+1)),"")
K3:K14K3=K2+(A3<>"")

Thank you for helping me out! The formula works when I write out a test sheet the way you did. But when I try and implement it into my actual worksheet it just repeats the first item until the end. I posted a picture of it as well so that makes a little more sense. I changed the formula a bit so that the columns match. And I've been playing around with it this morning trying to get something to work. I highlighted the 3 columns I'm trying to do this to in yellow (P, Q, & R). I also uploaded a picture of the formula in column M.
 

Attachments

  • 1575908302818.png
    1575908302818.png
    178.6 KB · Views: 13
  • Capture3.PNG
    Capture3.PNG
    8.6 KB · Views: 12
Upvote 0
Code:
=IFERROR(INDEX(P:P,AGGREGATE(15,6,ROW(P$1:P$32)/((T$1:T$32&""="0")*(S$1:S$32=S3)),ROW()-LOOKUP("ZZZ",L$1:L3,ROW(L$1:L3))+1)),"")
See if this is any use. It involves using a different formula in column B.
I have used column K as a helper column but you could use any column off to the right (& hide it if preferred).
Each formula copied down.

Book1
ABCDEFGHIJK
1
2
3JohnAppleApple01
4Orange1
5 Orange01
6 1
7NateApplePear32
8Orange2
9BerryApple02
10 Grape12
11 Orange02
12 Berry02
13 2
14 2
No blanks
Cell Formulas
RangeFormula
B3:B14B3=IFERROR(INDEX(D:D,AGGREGATE(15,6,ROW(D$1:D$30)/((J$1:J$30&""="0")*(K$1:K$30=K3)),ROW()-LOOKUP("ZZZ",A$1:A3,ROW(A$1:A3))+1)),"")
K3:K14K3=K2+(A3<>"")
 
Upvote 0
I posted a picture of it
Instead of a picture, can you give it to us in a form that we can copy, so that we have exactly what you have? My signature block below has help with that.
 
Upvote 0
Okay I finally figured out how to get it up there like that! Sorry that took me a while. I had a hard time figuring out how to get the add-on

So the first sheet I posted is what it currently looks like. With the formula from last week in columns M-O ( Highlighted blue). And the second one I posted is what I would like it to look like. (I just typed in the values) Everything from A-J works exactly like i would like it to.

P-R is automatically generated based on the info from A-J. It is a list of work orders and parts that will be needed to complete each one. And P-R is parts that we do not have enough of. If Column J has is 0 then that row is transferred to columns P-R. This is a spreadsheet I am making for work.

The part that I need help with is M-O (Highlighted in blue). If were comparing it to the names and fruit examples from last week then column A with the names is column L on mine (containing the letters SWO). and instead of fruits there is the names of parts. (cooler, bearing, sump cover, etc.)

I have been able to use what I have to create one list full of everything I will need to order. But I would like for other people to be able to open this and see the small list for each work order that contains all the parts we are short, right next to the work order.

I hope this is making sense. This is that last little piece I need to make it function exactly how I want and I'm stumped.

Also thank you so much for your help and patience!

Book1
ABCDEFGHIJKLMNOPQRS
2W/OS/NStatusParts RequiredQuantity NeededQuantity In Stock
3    0
4SWO-1123In Progress   SWO-1      1
5          1
6SWO-2124In ProgressLH Cooler145D1111-111111SWO-2Drain Hose145D1111-41   2
7RH Cooler145D1111-211882 Drain Hose145D1111-41   2
8Comb. Cooler 145D1111-311882 Drain Hose145D1111-41   2
9Drain Hose145D1111-411000 Drain Hose145D1111-41Drain Hose145D1111-412
10    Drain Hose145D1111-41   2
11SWO-2125In ProgressLH Cooler145D1111-112010SWO-2LH Cooler145D1111-11LH Cooler145D1111-113
12RH Cooler145D1111-212782 LH Cooler145D1111-11   3
13Comb. Cooler 145D1111-312782 LH Cooler145D1111-11   3
14Sump Cover145D1111-412-100 LH Cooler145D1111-11Sump Cover145D1111-413
15    LH Cooler145D1111-11   3
16SWO-3126In ProgressLH Cooler145D1111-113-110SWO-3LH Cooler145D1111-11LH Cooler145D1111-114
17RH Cooler145D1111-213682 LH Cooler145D1111-11   4
18Comb. Cooler 145D1111-313682 LH Cooler145D1111-11   4
19Bearings145D1111-424020 LH Cooler145D1111-11Bearings145D1111-424
20Cartridge145D1111-511000 LH Cooler145D1111-11Cartridge145D1111-514
21Tangwasher145D1111-611772 LH Cooler145D1111-11   4
22Drain Hose145D1111-711000 LH Cooler145D1111-11Drain Hose145D1111-714
23    LH Cooler145D1111-11   4
C-Boxes
Cell Formulas
RangeFormula
M3M3=IFERROR(INDEX(P:P,AGGREGATE(15,6,ROW(P$3:P$33)/((J$3:J$33&""="0")*(S$3:S$33=S3)),ROW()-LOOKUP("ZZZ",L$3:L4,ROW(L$3:L4))+1)),"")
P3, P4:P23P3=IF(J3="","", IF(J3=0,D3, ""))
Q3, Q4:Q23Q3=IF(J3="","", IF(J3=0,E3, ""))
R3, R4:R23R3=IF(Q3="","",IF(H3<1,F3,G3-H3))
S3, S4:S23S3=S2+(L3<>"")
G4:G23G4=IF(E4="","",SUMIF($E$4:E4,E4,$F$4:F4))
H4H4{=IF(F4="","",IF(ISERROR(I4-INDEX($G$4:$G$198,MATCH(10,1/($E2:$E$4=E4)))),I4,I4-INDEX($G$4:$G$198,MATCH(10,1/($E2:$E$4=E4)))))}
H5:H23H5{=IF(F5="","",IF(ISERROR(I5-INDEX($G$4:$G$198,MATCH(10,1/($E$4:$E4=E5)))),I5,I5-INDEX($G$4:$G$198,MATCH(10,1/($E$4:$E4=E5)))))}
L4:L23L4=IF(A4="","",A4)
M4:M23M4{=IFERROR(INDEX(P:P,AGGREGATE(15,6,ROW(P$4:P$33)/((J$4:J$33&""="0")*(S$4:S$33=S4)),ROW()-LOOKUP("ZZZ",L$4:L4,ROW(L$4:L4))+1)),"")}
N4:N23N4{=IFERROR(INDEX(Q:Q,AGGREGATE(15,6,ROW(Q$1:Q$33)/((J$1:J$33&""="0")*(S$1:S$33=S4)),ROW()-LOOKUP("ZZZ",L$1:L4,ROW(L$1:L4))+1)),"")}
O4:O23O4{=IFERROR(INDEX(R:R,AGGREGATE(15,6,ROW(R$1:R$33)/((J$1:J$33&""="0")*(S$1:S$33=S4)),ROW()-LOOKUP("ZZZ",L$1:L4,ROW(L$1:L4))+1)),"")}
J4:J23J4=IF(I4="","", IF(I4<G4,0,IF(I4>G4,2, IF(I4=G4, 1,))))
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
J4:J249Other TypeIcon setNO


Book1
ABCDEFGHIJKLMNOPQRS
2W/OS/NStatusParts RequiredQuantity NeededQuantity In Stock
3    0
4SWO-1123In Progress   SWO-1   1
5       1
6SWO-2124In ProgressLH Cooler145D1111-111111SWO-2Drain Hose145D1111-41   2
7RH Cooler145D1111-211882    2
8Comb. Cooler 145D1111-311882    2
9Drain Hose145D1111-411000 Drain Hose145D1111-412
10       2
11SWO-2125In ProgressLH Cooler145D1111-112010SWO-2LH Cooler145D1111-11LH Cooler145D1111-113
12RH Cooler145D1111-212782 Sump Cover145D1111-41   3
13Comb. Cooler 145D1111-312782    3
14Sump Cover145D1111-412-100 Sump Cover145D1111-413
15       3
16SWO-3126In ProgressLH Cooler145D1111-113-110SWO-3LH Cooler145D1111-11LH Cooler145D1111-114
17RH Cooler145D1111-213682 Bearings145D1111-42   4
18Comb. Cooler 145D1111-313682 Cartridge145D1111-51   4
19Bearings145D1111-424020 Drain Hose145D1111-71Bearings145D1111-424
20Cartridge145D1111-511000 Cartridge145D1111-514
21Tangwasher145D1111-611772    4
22Drain Hose145D1111-711000 Drain Hose145D1111-714
23       4
C-Boxes
Cell Formulas
RangeFormula
M3M3=IFERROR(INDEX(P:P,AGGREGATE(15,6,ROW(P$3:P$33)/((J$3:J$33&""="0")*(S$3:S$33=S3)),ROW()-LOOKUP("ZZZ",L$3:L4,ROW(L$3:L4))+1)),"")
P3:P23P3=IF(J3="","", IF(J3=0,D3, ""))
Q3:Q23Q3=IF(J3="","", IF(J3=0,E3, ""))
R3:R23R3=IF(Q3="","",IF(H3<1,F3,G3-H3))
S3:S23S3=S2+(L3<>"")
G4:G23G4=IF(E4="","",SUMIF($E$4:E4,E4,$F$4:F4))
H4H4{=IF(F4="","",IF(ISERROR(I4-INDEX($G$4:$G$198,MATCH(10,1/($E2:$E$4=E4)))),I4,I4-INDEX($G$4:$G$198,MATCH(10,1/($E2:$E$4=E4)))))}
H5:H23H5{=IF(F5="","",IF(ISERROR(I5-INDEX($G$4:$G$198,MATCH(10,1/($E$4:$E4=E5)))),I5,I5-INDEX($G$4:$G$198,MATCH(10,1/($E$4:$E4=E5)))))}
J4:J23J4=IF(I4="","", IF(I4<G4,0,IF(I4>G4,2, IF(I4=G4, 1,))))
L4:L23L4=IF(A4="","",A4)
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
J4:J249Other TypeIcon setNO
 
Upvote 0
Hey I got it figured out! The formula you gave me wasn't working because of a formula in one of the columns but I figured out a way around it! Thank you! I don't think I would have been able to get it without your help!
 
Upvote 0
I hadn't had sufficient time yet to get back and have a good look at this but glad you got it sorted. Thanks for letting us know. :)
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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