Home > OS >  Formula or Script, to replace manual data formatting?
Formula or Script, to replace manual data formatting?

Time:11-16

I have a highly repetitive manual task that I'm trying to automate.

A sheet 'Quantities' with the quantity of Codes I need to generate, based on a ticket type (eg; Adult | 174)

A sheet with the Codes descending, equal to the 'Total' sum value from 'Quantities' sheet

A sheet for each Ticket Type which requires 2 columns;

  1. descending ticket type string numbered values "Adult 1", "Adult 2", "Adult 3", etc, up to the total value of the 'Codes Required' from 'Quantities' sheet. Eg, up to "Adult 174"
  2. codes populated from the 'Codes' sheet, up to the value of the codes required for that ticket type, eg, the first 174 codes.

For the next ticket type (Junior), the codes would need to be taken consecutively from the 'Codes' sheet, eg the next 72 codes from rows 175-242.

Here is a worksheet with example data, and the example that I'm looking to generate; enter image description here

You can write these formulas, in A2:

=arrayformula(A1&" "&sequence(vlookup(A1,Quantities!A1:B7,2,false)))

In B2:

=Indirect("Codes!A"&SUM(INDIRECT("QUANTITIES!B1:B"&MATCH(A1,Quantities!A2:A,0))) 1&":A"&SUM(INDIRECT("QUANTITIES!B1:B"&MATCH(A1,Quantities!A1:A,0))))

I've put them in your sheet ;)

  • Related