How do you generate custom rows in excel without VB?

▼魔方 西西 提交于 2019-12-12 03:57:50

问题


I am trying to auto generate manual orders for import. Can this be done in excel without VB?

I am gathering subscription orders on sheet 1, and since it is a physical product being shipped I need to have one order for each non-recurring month. Sheet 1 will be filled by new processing orders, and I would like to be able to export sheet 2 without having to manually create each order.

  • This is the data that I start with on sheet1: Sheet 1 Order Details

  • This is the data that I want to generate on sheet2:

Sheet 2 - To be Exported


回答1:


You can do with formula, but you will need a little code to keep your eye on the data, as with formula, you'll do say, 1000 rows, then save it, but when your data hits 1001 rows, you need to add a further 1 row, so it can be considered inefficient to have 1000 rows, for 100 rows, but if you quickly get to the limit you've set, you can argue it is eventually efficient.

I've attached a picture

The formula are as follows

D2 filled down =MID(C2,1,FIND(" ",C2,1))

E2 =INT(D2)

E3 filled down =SUM($E$2:E2)+INT(D3)

G2 =A2

G3 filled down =IF(ROW()-2<VLOOKUP(G2,$A$2:$E$4,5,0),G2,INDEX($A$2:$A$4,MATCH(G2,$A$2:$A$4,0)+1,1))

H2 filled down =COUNTIF($G$2:$G2,G2)

I2 filled down =EDATE(VLOOKUP(G2,$A$2:$B$4,2,0),H2-1)

J2 filled down =VLOOKUP(G2,$A$2:$C$4,3,0)

K2 filled down =TEXT(I2,"mmm") & "_" & H2 & "_of_" & COUNTIF($G$2:$G$15,G2) & "-" & G2

Hope this helps



来源:https://stackoverflow.com/questions/41554272/how-do-you-generate-custom-rows-in-excel-without-vb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!