• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

layout query

Hi Guys,

I have a list of items and accessories in sheet 1.

Not all of the items or accessories will have a quantity to the left of them.

On sheet 2 I'm trying to list all the items and accessories that have a quantity marked

On sheet 2 I wanted to omit items or accessories that didn't have a quantity on sheet 1.

Is this possible at all.

I am just trying to produce an invoice with sheet 2 but I didn't want to have to keep hiding rows that weren't used.

I've attached a sample sheet to help explain.

Thanks in advance

Regards

Brian
 

Attachments

  • sheet 1.xlsx
    10.5 KB · Views: 0
Brian,

See attached.

Give this a test and see if it does what you're wanting.
 

Attachments

  • brian1.xlsx
    11.3 KB · Views: 0
Brian,

See attached.

Give this a test and see if it does what you're wanting.

Hi Eibi,

As usual I messed the formula up transferring it to my sheet.

I've attached a sample sheet again.

There is a delivery note and an invoice.

As before everything that has a value needs to appear on the invoice sheet.

Sorry to be a pain.

Regards

Brian
 

Attachments

  • Template edited.xlsx
    251.4 KB · Views: 0
Brian,

There are several issues affecting your application of the solution I provided. I'll try to address them one at a time.

1. One reason my suggestion is resulting in an error in your template invoice is the formatting differences between your original sample file and your actual template. Take a look at the number 3 in bold in the following formula:

=IFERROR(INDEX(Sheet1!B$4:B$46,(SMALL(IF(Sheet1!$B$4:$B$46>0,ROW(Sheet1!$B$4:$B$46)-3,FALSE),(ROW()/2)-1))),"")

The quantity 3 is a hard-coded value that matches the number of rows in the header of your source tab (based on your original sample file). In order to adapt the formula to the new template, this quantity should be changed to 9 because there are 9 rows in the 'Del & Col Note' tab before the first purchase item.​

2. Next (another formatting issue), take a look at the (ROW()/2)-1) portion of the formula -- this was specifically written to produce output on lines 4,6,8,10...in the original sample file. However, in your new template, you want the output on lines 30,33,36,39...so you would need to modify this element of the formula as well.

You can see that if we put Rows 4,6,8,10...in the original (ROW()/2)-1) formula, it results in the series 1,2,3.

In order to produce the same series (1,2,3) from the rows where you'll actually be using the formula (Rows 30,33,36,39...) you can see that you would need to change this as follows:

(ROW()/3)-9

But now there's another constraint to consider -- this is the only item where I have to scold...;) -- the blank rows between items on your source sheet aren't blank any more!! You added descriptions to the blank rows between items in 'Del & Col Note' Column A (e.g. multi-point doorsets, fire exit door set). This is problematic, because I original built the formula to find and pass through the (1,2,3...) non-blank rows of the source table, but now, the data you want to pass through is actually in the (2,4,6...) non-blank rows of the source table...so we need to create this new series (2,4,6...) from the row references (30,33,36,39...):

(ROW()-27)/3*2

We got it worked out this time; but next time, no curveballs, okay?:)

3. Next, we need to change every occurrence of 'Sheet 1' in my original formula to match the name of the corresponding tab in the new spreadsheet: 'Del & Col Note'. I see that you did this for the first occurrence, but not for the others...

4. Now, to revisit the B4:B46 references from the original formula. You had assumed that they should be A11:A33, but they should actually be A10:A33 if you want to pick up the first line of descriptive data you keyed in row 10 of your source table. Also, watch your absolute and relative references -- you dropped several $ from my original suggestion, which complicated the adapted formula.

So the new formula looks like this:

=IFERROR(INDEX('Del & Col Note'!A$10:A$33,(SMALL(IF('Del & Col Note'!$A$10:$A$33>0,ROW('Del & Col Note'!$A$10:$A$33)-9,FALSE),(ROW()-27)/3*2))),"")
5. Finally, you have to know the magic word in order to make this formula work...And I forgot to mention it in my original reply.

The magic word is "Array Formula" -- In case you haven't used these much before, you must confirm an array formula by pressing Control+Shift+Enter when you create or edit the formula rather than just Enter as you would when you create or edit other formulas.​

"Okay..." (I hear you saying.) "That's a little more 'help' than I bargained for..."

I've fixed the formula in the highlighted cells in the attached file. However, I haven't been able to easily test any data because you've got some data validation restrictions that won't work without the appropriate connections.

I notice that there are some other items you may want help with, but I'll wait for your lead on those.

I apologize that it's taken me so long to respond, but some personal and work items delayed me.

Feel free to ask if you need anything more. But note that you need to get your data layout finalized before you start building formulas...

All best.

Isaac
 

Attachments

  • brian2.xlsx
    251.4 KB · Views: 0
Brian,

There are several issues affecting your application of the solution I provided. I'll try to address them one at a time.

1. One reason my suggestion is resulting in an error in your template invoice is the formatting differences between your original sample file and your actual template. Take a look at the number 3 in bold in the following formula:

=IFERROR(INDEX(Sheet1!B$4:B$46,(SMALL(IF(Sheet1!$B$4:$B$46>0,ROW(Sheet1!$B$4:$B$46)-3,FALSE),(ROW()/2)-1))),"")

The quantity 3 is a hard-coded value that matches the number of rows in the header of your source tab (based on your original sample file). In order to adapt the formula to the new template, this quantity should be changed to 9 because there are 9 rows in the 'Del & Col Note' tab before the first purchase item.​

2. Next (another formatting issue), take a look at the (ROW()/2)-1) portion of the formula -- this was specifically written to produce output on lines 4,6,8,10...in the original sample file. However, in your new template, you want the output on lines 30,33,36,39...so you would need to modify this element of the formula as well.

You can see that if we put Rows 4,6,8,10...in the original (ROW()/2)-1) formula, it results in the series 1,2,3.

In order to produce the same series (1,2,3) from the rows where you'll actually be using the formula (Rows 30,33,36,39...) you can see that you would need to change this as follows:

(ROW()/3)-9

But now there's another constraint to consider -- this is the only item where I have to scold...;) -- the blank rows between items on your source sheet aren't blank any more!! You added descriptions to the blank rows between items in 'Del & Col Note' Column A (e.g. multi-point doorsets, fire exit door set). This is problematic, because I original built the formula to find and pass through the (1,2,3...) non-blank rows of the source table, but now, the data you want to pass through is actually in the (2,4,6...) non-blank rows of the source table...so we need to create this new series (2,4,6...) from the row references (30,33,36,39...):

(ROW()-27)/3*2

We got it worked out this time; but next time, no curveballs, okay?:)

3. Next, we need to change every occurrence of 'Sheet 1' in my original formula to match the name of the corresponding tab in the new spreadsheet: 'Del & Col Note'. I see that you did this for the first occurrence, but not for the others...

4. Now, to revisit the B4:B46 references from the original formula. You had assumed that they should be A11:A33, but they should actually be A10:A33 if you want to pick up the first line of descriptive data you keyed in row 10 of your source table. Also, watch your absolute and relative references -- you dropped several $ from my original suggestion, which complicated the adapted formula.

So the new formula looks like this:

=IFERROR(INDEX('Del & Col Note'!A$10:A$33,(SMALL(IF('Del & Col Note'!$A$10:$A$33>0,ROW('Del & Col Note'!$A$10:$A$33)-9,FALSE),(ROW()-27)/3*2))),"")
5. Finally, you have to know the magic word in order to make this formula work...And I forgot to mention it in my original reply.

The magic word is "Array Formula" -- In case you haven't used these much before, you must confirm an array formula by pressing Control+Shift+Enter when you create or edit the formula rather than just Enter as you would when you create or edit other formulas.​

"Okay..." (I hear you saying.) "That's a little more 'help' than I bargained for..."

I've fixed the formula in the highlighted cells in the attached file. However, I haven't been able to easily test any data because you've got some data validation restrictions that won't work without the appropriate connections.

I notice that there are some other items you may want help with, but I'll wait for your lead on those.

I apologize that it's taken me so long to respond, but some personal and work items delayed me.

Feel free to ask if you need anything more. But note that you need to get your data layout finalized before you start building formulas...

All best.

Isaac


Hi Eibi,

So sorry to have caused you so much work.

Thank you so much for your help.

Now you've described what the relevant parts of the formula refer to, it has made things a lot clearer.

Hopefully I can try and learn a bit more, knowing that information.

Thank you again, your help is invaluable.

I wish you a good day, and a good weekend.

Kind regards,

Brian
 
No need to apologize for the work -- I volunteered to help because it looked like a good challenge.

My lengthy explanation is only offered to help describe the logic behind the formula, so you can make it your own.

Don't hesitate to ask if you need even more help; I want to make this spreadsheet do just what you want.
 
No need to apologize for the work -- I volunteered to help because it looked like a good challenge.

My lengthy explanation is only offered to help describe the logic behind the formula, so you can make it your own.

Don't hesitate to ask if you need even more help; I want to make this spreadsheet do just what you want.

Hi Eibi,

I'd be lost without guys like you.

I've attached my sheet. I'm almost there.

On the invoice it isn't pulling through item 12 for some reason.

For the accessories I really need two columns on the delivery sheet to accomodate the amount of options.

What I've done is to copy these down in a list on rows 130 to 151 (I've hidden some rows so they are clearly visible)

Is there any way the invoice can pull through from the delivery note rows 17 to 40 (main items) if a quantity is entered, then rows 130 to 151 (accessories) if a quantity is entered.

I really do appreciate all the help you've given me on this Eibi.

Thanks in advance,

Regards

Brian
 

Attachments

  • template 20-8.xlsx
    83.7 KB · Views: 0
Regarding your formula failing to pull through Item 12. Look at the $A1 part of the formula I've put in bold below:

=IFERROR(INDEX('Del Note'!B$18:B$63,SMALL(IF('Del Note'!$A$18:$A$63<>0,IF('Del Note'!$A$18:$A$63<>"",-17+ROW('Del Note'!$A$18:$A$63))),ROW($A1))),"")

I notice that you've incremented this Row Reference by one in each Item (A1,A2,A3,A4) -- except on Item 12, instead of ($A12) you have ($A13). A typo, I believe...

Regarding the second item -- pulling the accessories through. I think this is simply a matter of changing the references accordingly. See attached and let me know if I misunderstood your request.
 

Attachments

  • brian3.xlsx
    83.6 KB · Views: 0
Back
Top