我正在与您分享this表格,以便您可以查看并给我一个合适的解决方案。基本上我想要做的是根据在"购买"中输入的数据生成发票。但我不知道怎么做,因为批号并不总是按照正确的顺序排列。因此,如果您注意到" Sale&库存"表,我必须为一张发票创建多个条目。是否有更简单的方法来自动生成发票?我不想要超过30手/发票。
谢谢,
Huzaifa。
答案 0 :(得分:1)
我不能发表评论来提问,所以我假设你想要从某个日期开始的所有拍品。请参阅发票'来自this spreadsheet的标签(我复制了你的标签)。更改黄色下拉列表应为您填写发票。您还可以创建多个页面,使其保持A4大小。
我还必须确保C&C在购买'标签被格式化为日期' yyyy-mm-dd'使用'格式'菜单。
我是通过将=QUERY(Purchases!$A$2:$T$500,"Select B where B<>'' and C >= date '"&TEXT(REGEXEXTRACT(K3,"[0-9]{6}"),"20##-##-##")&"' and C <= date '"&TEXT(REGEXEXTRACT(L3,"[0-9]{6}"),"20##-##-##")&"' limit 30 offset "&IF(M6=1,0,(M6-1)*34)&"",0)
添加到&#39; Invoices&#39;中的单元格H8
(突出显示为绿色)来完成此操作的。标签
工作原理:
=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
")
如果您对发票有不同的标准,请告诉我,我可以提供帮助,但请尝试查看您是否可以先从here了解发票。