Google sheets 如何在谷歌表单中自动填写发票中的数据

Google sheets 如何在谷歌表单中自动填写发票中的数据,google-sheets,Google Sheets,我和你们分享这张表,这样你们可以看一下,给我一个合适的解决方案。基本上,我想做的是根据“采购”中输入的数据生成发票,但我不知道如何做,因为批号并不总是按照正确的顺序。因此,如果您注意到在“销售和库存”表中,我必须为一张发票创建多个条目。是否有更简单的方法自动生成发票?我不要超过30批/发票 谢谢 Huzaifa.我不能留下评论来问问题,所以我想你会想要某个日期的所有物品。请参阅(我复制了您的)中的“发票”选项卡。更改黄色下拉列表将为您填写发票。您还可以创建多个页面,使其保持A4大小 我还必须使用

我和你们分享这张表,这样你们可以看一下,给我一个合适的解决方案。基本上,我想做的是根据“采购”中输入的数据生成发票,但我不知道如何做,因为批号并不总是按照正确的顺序。因此,如果您注意到在“销售和库存”表中,我必须为一张发票创建多个条目。是否有更简单的方法自动生成发票?我不要超过30批/发票

谢谢


Huzaifa.

我不能留下评论来问问题,所以我想你会想要某个日期的所有物品。请参阅(我复制了您的)中的“发票”选项卡。更改黄色下拉列表将为您填写发票。您还可以创建多个页面,使其保持A4大小

我还必须使用“格式”菜单确保“采购”选项卡上的C列格式为日期“yyyy-mm-dd”

为此,我添加了
=QUERY(购买)$A$2:$T$500,“选择B,其中B''和C>=date'”&TEXT(regextract(K3,[0-9]{6}”),“20#-#-#-#-#-#-#-#-#-#-#-#-#”和“C=date”&&TEXT(regextract(K3,[0-9]{6}”),“20#-#-#-#”
//确保日期大于或等于
//在批次代码和格式中找到的开始日期
//它被称为“yyyy-mm-dd”,这对于
//查询函数
和C
=QUERY(
Purchases!$A$2:$T$500,                  //the data I want to query
"Select B                               //tells it which column i want data from
where B<>''                             //make sure column B is not blank

and C >= date '"&TEXT(REGEXEXTRACT(K3,"[0-9]{6}"),"20##-##-##")&"'
                                        //makes sure the date is greater than or equal to
                                        //the start date found in your lot code and formats
                                        //it as 'yyyy-mm-dd' which is necessary for the
                                        //query function

and C <= date '"&TEXT(REGEXEXTRACT(L3,"[0-9]{6}"),"20##-##-##")&"'
                                        //makes sure the date is less than or equal to
                                        //the start date found in your lot code and formats
                                        //it as 'yyyy-mm-dd' which is necessary for the
                                        //query function

limit 30                                //restricts the returned results to 30 so it does
                                        //not exceed the number of lines on your invoice

offset "&IF(M6=1,0,(M6-1)*30)&"         //this shows the 'page' of data that you select
")