Listing Non-Zero Values and their Headings

scarrott

New Member
Joined
Jan 17, 2022
Messages
4
Office Version
  1. 365
Platform
  1. Windows
I'm trying to put together a system to quote on jobs. One part of the quoter is showing how much labour is required depending on the jobs selected. I need to make a list of all the labourers required for the selected jobs, and the number of hours work required for each in total, ignoring any that have a total of 0 work. Like the following example.

Example.xlsx
ABCDEF
1JobPlastererElectricianJoinerDecoratorPlumber
2Add Spotlights13
3Skim Wall42
4Extractor fan51
5Tile Walls9
6Replace Bath14
7Total580314
8
9
10
11Work Required
12Plasterer5
13Electrician8
14Decorator3
15Plumber14
Sheet1
Cell Formulas
RangeFormula
B7:F7B7=SUM(B2:B6)


Can anyone help with a formula for the Work Required section?
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Something like this ?

Mappe1
ABCDEF
1JobPlastererElectricianJoinerDecoratorPlumber
2Add Spotlights13
3Skim Wall42
4Extractor fan51
5Tile Walls9
6Replace Bath14
7Total580314
8
9
10
11Work Required
12Plasterer5
13Electrician8
14Decorator3
15Plumber14
Ark1
Cell Formulas
RangeFormula
B7:F7B7=SUM(B2:B6)
B12:B15B12=SUMPRODUCT($B$2:$F$6*(($B$1:$F$1=A12)))
 
Upvote 0
Thanks for the reply. Sorry, but I don't think I made it clear. I need the formula to pull in the headings too. So, in cells A12 down it would need to pull in the headings which have a value not equal to zero, and in B12 down it would need to pull in the totals for those headings. Basically, I need to make a nice list of labourers and the time they are needed for on a separate sheet. Hope that makes sense!
 
Upvote 0
Hi & welcome to MrExcel.
Another option
+Fluff 1.xlsm
ABCDEF
1JobPlastererElectricianJoinerDecoratorPlumber
2Add Spotlights13
3Skim Wall42
4Extractor fan51
5Tile Walls9
6Replace Bath14
7Total580314
8
9
10
11Work Required
12Plasterer5
13Electrician8
14Decorator3
15Plumber14
16
Main
Cell Formulas
RangeFormula
B7:F7B7=SUM(B2:B6)
A12:B15A12=LET(m,MMULT(SEQUENCE(,5,,0),--(B2:F6)),TRANSPOSE(FILTER(CHOOSE({1;2},B1:F1,m),m>0)))
Dynamic array formulas.
 
Upvote 0
That looks great Fluff, just the ticket, thanks.

I assume there is no easy way to do this in older versions of Excel? I'm making this for someone else and I think they are on an older version.
 
Upvote 0
You could try
Excel Formula:
=IFERROR(INDEX($B$1:$F$1,AGGREGATE(15,6,(COLUMN($B$1:$F$1)-COLUMN($B$1)+1)/(MMULT(COLUMN($A:$E)^0,--($B$2:$F$6))>0),ROWS(A$12:A12))),"")
for the trades.
 
Upvote 0
Solution
Amazing. I've done that and used a simple HLOOKUP to get the totals for each. Thanks so much for the help!
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0
Amazing. I've done that and used a simple HLOOKUP to get the totals for each. Thanks so much for the help!
I can see you already got a working solution. For older versions, another way are, in A12, and down.
{=IF($B12="";"";INDEX($B$1:$F$1;SMALL(IF($B$7:$F$7=$B12;COLUMN($B$1:$F$1)-COLUMN(B$2)+1);COUNTIF($B$12:B12;B12))))}
 
Upvote 0
Never thought of using the total, so my formula can be simplified to
Excel Formula:
=IFERROR(INDEX($B$1:$F$1,AGGREGATE(15,6,(COLUMN($B$1:$F$1)-COLUMN($B$1)+1)/($B$7:$F$7>0),ROWS(A$12:A12))),"")
 
Upvote 0

Forum statistics

Threads
1,215,583
Messages
6,125,664
Members
449,247
Latest member
wingedshoes

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