to use count of rows displayed in details section to suppress header section - crystal-reports-xi

i am taking the count of rows displayed in details section in a counter variable. how can i use this count value in group header so that i can suppress header if count=0

First, Crystal can't normally display a group header if there are no individual records for that group. An exception would be if the incoming dataset was specifically set up with rows that are nearly blank.
In the section expert, go to the details section.
Under the group header section, open the custom formula editor for the suppress option.
Enter if count({keyfield},{group})=0 then True else False. This counts the number of occurrences of {keyfield} per {group}. If the count is 0, then the group header is suppressed.

Related

Compiling a list using INDEX but need to skip certain rows

I'm compiling a list based on the first answers recieved between row N and AF.
I'm using these two formulas:
=INDEX(N2:O2,MATCH(FALSE,ISBLANK(N2:O2),0))
and
=INDEX(R2:AF2,MATCH(FALSE,ISBLANK(R2:AF2),0))
Is there a way to combine them whilst not searching in rows P & Q?
These are generated from a Form response so can't just be switched around.
try:
=INDEX({N2:O2, R2:AF2}, MATCH(FALSE, ISBLANK({N2:O2, R2:AF2}), 0))
If Sheet1 is an intake sheet of form results, you should not add any data, formulas or even formatting to that sheet. It virtually always causes issues. A form intake sheet should be left exactly as it is. A new sheet can then be used to bring over the results of the form intake sheet as you want to see them.
However, since you didn't specify any of that, I will supply a formula written to work in the same sheet as your posted example and in-sheet examples.
Clear an entire column and place the following in the top cell of that column:
=ArrayFormula({"Attendee Name"; IF(E2:E="",,IFERROR(REGEXEXTRACT(TRIM(TRANSPOSE(QUERY(TRANSPOSE(FILTER(IF(N2:AK="",,N2:AK&"~"),N1:AK1=N1)),,COLUMNS(N1:AK1)))),"\s*([^~]+)"),"(none listed)"))})
This one formula will produce a header (the text of which you can change within the formula itself as you lie) and all valid results for all rows.
The inner IF will append a tilde (~) to any non-null entries in the range N2:AK.
FILTER will keep only those columns in this range where the header is the same as the header in N1 (i.e., "Attendee Name").
TRANSPOSE(QUERY(TRANSPOSE( ),,COLUMNS( ))) is colloquially called a "Query smash." It will form one cell from all horizontal results per row.
TRIM will cut any preliminary spaces and form a true string.
REGEXEXTRACT will pull the from the first non-space character up to but not including the first tilde (from those appended in the first step)—in other words, the first full valid entry from any column.
IFERROR will return a message if there is an error, with the likely error being that there were no valid entries for "Attendee name" in any column.
The outer IF will leave the cell blank if the no training event exists in E2:E.
{ } forms a virtual array that places the header over all other results.
ArrayFormula( ) signifies that multiple results will be processed at once.
Because this is an array formula that is being "asked" to process every row, you cannot manually type into any cell of this results column. If you do, you will "break the array"; everything except what you just typed will disappear, leaving only an error in the formula cell. If you need to add or change a name, you need to do that in the raw results range (e.g., manually type a name or a new name in Col N), which will then turn up in the formula output range.

Use Arrayformula to auto-populate column in Google Sheets based on condition

I'll do my best to explain this. So, I want to use Arrayformula to autofill column based on a condition.
=IFERROR(QUERY(ARRAYFORMULA(IF((Research!$B$1:$B$100)="Yes",REGEXEXTRACT(Research!$A$1:$A$100,".*"),)),"WHERE Col1 is not null")).
It does what it's supposed to, but the problem comes if that condition changes at any point (so it's not true anymore) the value in the cell filled with the array will get deleted but will also offset all the other rows after it (same happens if I insert new row with 'Yes' value in between other rows, in my Research sheet from where I extract my data from).
Is there any way if I need to make changes to the condition in the sheet from where I extract data > and not offset everything else in the sheet where I use the array formula? (either delete the entire row if the value doesn't meet the condition anymore, or insert new row if it meets the condition (not just replace the value in previous cell in its spot, cuz then all the other fields are mismatched). I'm a beginner with excel, I hope that makes sense. Sheet ex
Condition in Main Sheet > Result in Array sheet
(these are the ok examples)
Changed value to yes for Agency 3 > Inserted in Agency's 5 place > and offsets everything after it
Please refer to the spreadsheet for my examples.
Method A: Separate the sheets of input and output
Method B: Input on Research and output on Initiative
Method C: Use Google Apps Script to 'avoid' offset upon change of Take? value. (example is not provided)

Google sheet query with header and detail

I have a file with identical rows of which I want to make "headers" like in the link below.
Is that possible with formula or script?
Thank you.
Test file
I used the condition of a changing group to build an array of row numbers that can "sort into" the original array to display the header and an empty row between sections. I used this formula. You can find it in A2 of the MK.Idea tab.
=ARRAY_CONSTRAIN(SORT({Data!F2:G\ROW(Data!F2:F);IF(Data!A2:A&Data!B2:B&Data!C2:C&Data!D2:D&Data!E2:E<>Data!A1:A&Data!B1:B&Data!C1:C&Data!D1:D&Data!E1:E;{Data!A2:A&"-> "&Data!B2:B&"-> "&Data!C2:C&"-> "&Data!D2:D&"-> "&Data!E2:E\SPLIT(" |"&ROW(Data!A2:A)-0,1;"|";0;0)};IF(Data!A2:A&Data!B2:B&Data!C2:C&Data!D2:D&Data!E2:E<>Data!A3:A&Data!B3:B&Data!C3:C&Data!D3:D&Data!E1:E;IFERROR(SPLIT(" | |"&ROW(Data!A2:A)+0,1;"|";0;0));))};3;1);9^9;2)

How to use index function to return the value of the last cell that isn't blank

I am keeping a dynamically updated Google Sheets file of team performance where certain cells are updated by a team member, and there is a dashboard at the top that pulls only the most recent numerical values inputted. I need to find a formula for the dashboard section at the top to return the value of the last cell that isn't blank in a non-sequential selection. for example, the cells would be:
B30, B43, B56, B69, B82, etc.
Is there a way to use CHOOSE, INDEX, or something similar to do so?
the answer is: don't use INDEX. for a last non-empty row use:
=ARRAYFORMULA(INDIRECT("B"&MAX(IF(B:B<>"", ROW(B:B), ))))
=IF(B294<>"", B294,
IF(B273<>"", B273,
IF(B252<>"", B252,
IF(B231<>"", B231,
IF(B210<>"", B210,
IF(B189<>"", B189,
IF(B168<>"", B168,
IF(B147<>"", B147,
IF(B126<>"", B126,
IF(B105<>"", B105,
IF(B84 <>"", B84,
IF(B63 <>"", B63, ))))))))))))

Sum above cells ignoring blanks

I have a spreadsheet where I have data from a bank account. Each bank transaction has a date and an indication if that transaction is already done or if it's just expected. When it's already done, it must be added to the total balance up to date. If not, then the total balance up to date must be blank. I need to autofilter the data, so I can filter and order it depending on date or other conditions, that's why I've been using this formula:
=IF(D3="Y";B3+INDIRECT(ADDRESS(ROW()-1;COLUMN()));"")
Problem here is that when the cell above is blank, total sum resets and it starts from the value of that transaction. I need a formula that ignores the upper blank cells, and sums all cells above that are not blank plus the amount of that transaction.
Besides, once I change the "N" in "Done" Column to a "Y" I need the formula to update and show the correct balance.
I share an example sheet for better understanding https://docs.google.com/spreadsheets/d/1_gk0YaziUhOZfRbrlfHizMrVu6OT7njIaTUyQaE6Lbs/edit?usp=sharing
Ok I THINK I understand what your going for - please let me know if I am confused, but I added an example on your sheet.... basically what I ended up doing was including one of your conditionals, but then also adding another function to exclude the blank rows by way of filter , index and counta It looks more complicated than it is because I nested it all back into one formula:
=IF(I3="Y";sum(G3;index(filter(indirect("F2:"&address(row()-1;column();4));ISNUMBER(indirect("F2:"&address(row()-1;column();4))));counta(filter(indirect("F2:"&address(row()-1;column();4));ISNUMBER(indirect("F2:"&address(row()-1;column();4)))))););)
To work it from the inside out - the way I am excluding the blank rows is by using FILTER to get all the rows from the first row with a value ( Like A2 in your example) and using INDIRECT and ADDRESS to end the array I want to include exactly one cell above the current cell.
Then I use the condition that the range I built has a number value in it, there fore excluding the blanks.
In order to get the last value available, I use COUNTA to find out the total rows in the filter, then wrap the formula with INDEX to use the counta value as the row to return (which automatically is the last row available above the current cell)
Try this in A3 and copy down:
=IF(D3="Y";B3+INDIRECT(ADDRESS(ROW()-1;COLUMN()));A2+0)
If you want to display the "N" rows as blank, add a column (B) fill in the header and the starting number (5000) then put this in B3:
=if(E3="N";"";A3)
Copy it down then hide column A.

Resources