array print in foreach loop than invoice no gap fill - foreach

get result
want to result please help this
The missing invoice number in an invoice series should only be displayed till the end.
like this only date value but i want to number value

Related

Automatically fill sum column

I have a table of items with its buying and selling rates. Against each transaction, I wanted to show the item qty currently available and the current cost. Here is a screenshot of the table.
For the columns of Qty and Rate, I have used the formulas as shown below:
=SUMPRODUCT(C$2:C-F$2:F,B$2:B=B2,A$2:A<=A2)
=SUMPRODUCT(I$2:I/J2,B$2:B=B2,A$2:A<=A2)
Is it possible to convert SUMPRODUCT formulas as an array formula (returning array) so that it automatically fills whenever a row is added? Something like filling a column using FILTER or QUERY?
Regards,
Pravin Kumar.
I am making an assumption that this is your goal:
To automatically fill the quantity remaining column with the result of the difference between the two values, if and only if, there are two values provided.
A solution to this objective is:
=arrayformula(if(and(C2:C<>””, F2:F<>””), C2:C-F2:F, “”))
This produces a formula that subtracts C from F only if both C and F have values, and for all rows that have values in both C and F. If one of the rows does not have a value, the result will yield “” (blank). This formula should be posted at the top of the column where you want these results to start. In your screenshot example this would be cell J2. NOTE: 0 is still a value, and also that an array formula will not overwrite manually input data, so once you paste that function in J2, you will have to clear the cells below in order for it to auto populate.

How do I get the range of holidays for NETWORKDAYS from a LOOKUP?

I am trying to grab a list of holidays from another sheet using an HLOOKUP to find the appropriate row based on country to get a list of holidays for the NETWORKDAYS function. However, when I try to do this I simply get a #REF error that says HLOOKUP evaluates to an out of bounds range.
I have a sheet called Billable Days that has a list of holidays based on country. Cells J14:N14 contains the country, and in a list below that is a bunch of holiday dates. They are varying ranges. For example, the US holidays range from J15:J32.
In a different sheet, I need to pull the correct holidays based on the country in column R into a NETWORKDAYS function.
First I tried:
=NETWORKDAYS(B2,S1,HLOOKUP($R2,'Billable Days'!$J$14:$N$14,15:50,FALSE))
This gives me an #VALUE error saying: "An array value could not be found"
Then I tried:
=NETWORKDAYS(B2,S1,ArrayFormula(HLOOKUP($R2,'Billable Days'!$J$14:$N$14,15:50,FALSE)))
Which gives another value error.
Finally, I tried
=NETWORKDAYS(B2,S1,ArrayFormula(HLOOKUP($R2,'Billable Days'!$J$14:$N$14,{15,16,17},FALSE)))
Just to test it out to see if I could get any values, and got a #REF error that said "HLOOKUP evaluates to an out of bounds range"
Can anyone help me craft this function? I'm not even sure if HLOOKUP is the way to go here, but it was the only way that came to mind.
EDIT
For clarity and as requested, I created a sheet to demonstrate what I mean. Find it here.
You will see the Consultants and Billable Days sheets. You can see the function I wrote to calculate the NETWORKDAYS based on the start and end date. However, in that function I want to add the appropriate list of holidays from the Billable Days sheet to the NETWORKDAYS function as the third parameter. I need something that looks at the country column and finds the appropriate holiday dates from the Billable Days spreadsheet, then inserts it into the NETWORKDAYS calls. I cannot figure out how to accomplish this.
Here is how to construct what you wish.
On the consultants sheet in L2 I placed =address(2,match(E2, 'Billable Days'!$A$1:$F$1,0)), which finds the column index of the desired country and construct a proper cell name for it with row B. Then in M2 I say ="'Billable Days'!"&L2&":"&mid(L2,2,1) to construct a string referring to the desired holiday range, like 'Billable Days'!$B$2:B. Columns L and M can be dragged down for all the people. Then when you want the holiday list for the consultant in the second row say =INDIRECT(M2) or in the 5th row =INDIRECT(M5), or if you are building it into another formula, drop the = sign. You could clean it up a little to be graceful when the country is not found, or possibly to make an ArrayFormula and avoid the dragging.

Iterate COUNTIF on a column by pasting form over the column

I would like to iterate the countif form to an entire column with LibreOffice
The form is:
=COUNTIF(P$2:P$5041,R2)
The Table looks like this:
P R
Exp_NotGen_Aha_NotSolved_Recog Exp_Gen_Aha_Solved_Novel
Exp_Gen_NoAha_Solved_Rem Exp_Gen_Aha_Solved_Rem
Base_Gen_NoAha_Solved_Novel Exp_Gen_Aha_Solved_Recog
Exp_Gen_NoAha_Solved_Recog Exp_Gen_Aha_NotSolved_Novel
Exp_Gen_NoAha_NotSolved_Novel Exp_Gen_Aha_NotSolved_Rem
Base_Gen_NoAha_Solved_Recog Exp_Gen_Aha_NotSolved_Recog
Exp_Gen_NoAha_Solved_Rem Exp_Gen_NoAha_Solved_Novel
(...)
So with my form I intent to count up every time I find a name on the column P, which is the same as the name on the column R.
The form returns me the correct number of occurrences (which is e.g 41 on the first line of the column R). But then, when I try to copy and paste the form in order to repeat the calculation for the other rows in R, then I get just blank cells. If i sellect the cell I can see that the form is there (e.g this is what I get when I click over the cell with the result of R2: =COUNTIF(P$2:P$5041,R3) ). But there's no visible output.
Does anybody has any idea why do I get no output?
I know what was the problem. The forms in the sheet weren't being updated. To solve this problem you have to do the following:
Choose Data - Calculate - AutoCalculate (you see a check mark next to the command when AutoCalculate is enabled).
That's it.

How to automatically fill data in an invoice in Google Sheets

I am sharing this sheet with you so that you can have a look and give me a proper solution. Basically what I want to do it generate an invoice based on the data entered in "Purchases" but I don't know how to do it as the lot numbers aren't always in the proper sequence. Therefore, if you notice in the "Sale & Inventory" sheet, I have to create multiple entries for one invoice. Is there a simpler method where the invoices are generated automatically? I don't want more than 30 lots/invoice.
Thanks,
Huzaifa.
I can't leave a comment to ask a question, so I assumed you'd want all lots from a certain date. Please see the 'Invoice' tab from this spreadsheet (I duplicated yours). Changing the yellow drop-downs should fill the invoice for you. You can also create multiple pages so it stays A4 size.
I also had to make sure column C on the 'Purchases' tab was formatted as a date 'yyyy-mm-dd' by using the 'Format' menu.
I did this by adding =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) to cell H8 (highlighted green) in 'Invoices' tab.
How it works:
=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
")
Let me know if you have different criteria for invoices and I can help, but try and see if you can figure it out from here first.

Call center Calculating monthly and annual percentage

I'm trying to put together management information for a call center.
I've got the following info on every call that gets logged:
[CreatedOn] = Date & time of creation
[Case_status_name] = Reason for closing the call (Answered by 1st line, transferred to 2nd, call back request etc.)
Now what I'm looking to make is a graph which will show in one line the % of calls that were answered by the 1st line and the annual average% of calls closed by the first line during the last 12 months.
I can get the months from [CreatedOn] with the extract function, the same goes for the year.
I can group the [Case_status_name] in 1st line answered and everything else with a simple if statement.
But I'm having trouble getting the percentages right for both the month and the year together.
I can get sensible data if I only calculate the yearly average or if I calcluate the monthly average. But when I try to do them together, I wind up getting all kinds of crazy values.
What is a proper way to get the monthly and annual percentage in the same table?
Create Query
Add Column [Month] with expression
_first_of_month([CreatedOn])
Add Query Item [Total] with expression
1
Add Query Item [Answered by 1st line] with expression
case when [Case_status_name] = 'Answered by 1st line' then 1 else 0 end
Add Query Item [closed by the first line] with expression
case when [Case_status_name] = 'closed by the first line' then 1 else 0 end
Filter this Query
[CreatedOn] between _first_of_month(_add_months(current_date;-12))
and _last_of_month(_add_months(current_date;-1))
Add Query Item [% of calls answered by the 1st line] with expression
[Answered by 1st line] / [Total]
Add Query Item [12-month average] with expression
sum([closed by the first line] for report) / sum([Total] for report)
Build Graph based on this Query

Resources