google spreadsheet array length varies. I'm left with -- after shorter array calculations - arraylist

In google spreadsheet, my array length varies. I'm left with -- or a double dash after a shorter input is calculated and placed into the array or if i clear the input entirely.
Ex.formula =iferror(if(E10="",transpose(split(upper(D1),",")),query(vlist)),"")
The above will either take input from E10 or D1. If i clear all the input im left with -- in some cells. If shorter input is calculted I'm also left with -- in previous longer array positions.
Is there any way I can eliminate the possibliity of -- appearing in
cells?
Maybe I the original question should be, How can a fixed array
ignore null values and not output -- or double dash.

I have been struggling with this, too. And now i found a workaround to it in this forum answer.
The workaround is not to suppress the -- directly, but to handle them in the cells that use this data. You can handle them with the ARRAYFORMULA(IFERROR( functions.
I realized that if you have several cells where you use this data, instead of changing all these cells, a more comfortable way to do this is to
create an (invisible?) "helper" array somewhere else in your sheet, where you put your formula that creates the --
apply the workaround in the cell where you originally had your formula.
Example:
Cell A1 contains =SORT(UNIQUE(Sheet2!X:X)) (which eventually results in -- in the cells A2, A3,... if the number of unique values in column X on sheet 2 decreases).
Workaround: Use your formula =SORT(UNIQUE(Sheet2!X:X)) e.g. in cell B1 and put =ARRAYFORMULA(IFERROR(B:B)) in A1.

Related

LibreOffice Calc: how to highlight the maximum value of ranges of cells at once?

I would like to highlight the maximum value for each group of cells using conditional formatting, and applying it at once.
In order to explain myself better, the file is something like this:
(But the real content has more than 1500 of these).
For each range in each column, I want to highlight the maximum value. So, for the range A1:A11, the cells A2, A5, A7 and A10 should be with a different format. The same for the range A18:A28, where A26 and A28 should be different, and so on for B, and C, etc.
I have tried selecting A1:I28 and apply conditional format where cell is equals to max(a1:a11) apply a good format, but it doesn't work well. It think I don't how to use the references in the sheet in order to be considered in a right way.
Any ideas?
AFAIK you can't do this "at once", thus in a single step. To get this working with a spreadsheet layout as in your example, you'll have to define the conditional formatting for each "dataset" separately (it would be easier if the spreadsheet wouldn't contain two "rows" (1st: 1-11; 2nd: 18-28) on the same sheet). With dataset, i mean the distinctive ranges A1:A11, B1:B11, ... A18:A28, B18:B28 and so on.
To be more precise: you need to define the conditional formatting rule for the first dataset of its row (in your example: A1:A11 and A18:A28, respectively), then you can apply it to the other datasets using format pasting.
To do so:
define the conditional formatting for range A1:A11 with formula A1=MAX(A$1:A$11). Notice the dollar signs - without them LO will compare A2 to MAX(A2:A12), A3 to MAX(A3:A13) and so on. The dollar signs make sure that every cell in A1:A11 will be compared to exactly that range only.
Select A1:A11, copy it;
Select B1:B11 and paste just the formatting, using the "Paste Special" functionality (Menu Edit -> Paste Special... or SHIFT+CTRL+V, select Format only in the Paste Special dialogue).
Repeat step 3 for C1:C11, D1:D11 and so on till I1:I11;
Repeat step 1 and 2 for A:18:A28 (formula should be A18=MAX(A$18:A$28));
Repeat step 3 for B18:B28 and so on.
If you try to paste the formatting to more than one column, LO won't handle the target range as entity but will define the formatting for each cell, thus it will define a conditional format for B1 with formula B1=MAX(B$1:B$11), B2 with B2=MAX(B$2:B$12) and so on. It's vital to have only one conditional format definition for each separate range, thus for A1:A11, B1:B11 and so on. You can control how LO had handled your modifications by checking the resulting conditional format definitions in Menu Format -> Conditional Formatting -> Manage....

Use the same formula multiple times for multiple cells containing dropdown lists

My file looks something like this
image
An IF statement would be too long considering I have 20 different long formulas.
Update: I later tried to use an IF statement but failed because it depended on substitute function to replace cell references in the equation but substitute returned a string which coudn't be used as a function by IF.
User should be able to increase available rows by simply copy and insert the previous row.
I can use index match to copy a cell's value which contain the right formula according to the dropdown list but when the user select the same item again I can't update the formula with the new values without affecting the previous cell which used the same formula.I couldn't find a way to copy the same formula several times and replace cell references in it (without human interaction like search and replace) i.e. by using Substitute function which couldn't replace cell references as it looks through the cell's value not it's formula (the cell which contain the main formula).Here is one of the 20 formulas I have
=(Tables!O167*144/(Tables!O158*Tables!O159)/4005)^2*INDEX(Tables!A159:L200;MATCH(INDEX(Tables!A159:A200;MATCH(TRUE;INDEX(Tables!A159:A200>=Tables!O158*Tables!O159/(Tables!O160*Tables!O161);0);));Tables!A159:A200;0)+MATCH(INDEX(Tables!B159:B200;MATCH(INDEX(Tables!A159:A200;MATCH(TRUE;INDEX(Tables!A159:A200>=Tables!O158*Tables!O159/(Tables!O160*Tables!O161);0);));Tables!A159:A200;0)+MATCH(INDEX(Tables!B159:B200;MATCH(TRUE;INDEX(Tables!B159:B200>=Tables!O164/(2*Tables!O158*Tables!O159/(Tables!O158+Tables!O159));0);));Tables!B159:B200;0)-1;);Tables!B159:B200;0)-1;MATCH((INDEX(Tables!C158:L158;MATCH(TRUE;INDEX(Tables!C158:L158>=Tables!O163;0);)));Tables!A158:L158;0))I tried to use FORMULATEXT to convert the formula into a string then use substitute to replace the cell references then use the depreciated Evaluation function but hit the 255 char limit. I searched a lot on google but to no avail, I don't mind a VBA code but a macro free method would be better, Thanks.
TL;DR: Is there a way to copy a formula stored in a cell and replace some of the cell references then enter it in another cell multiple times with different cell references each time ??
Try this in E2 and fill down.
=CHOOSE(MATCH(LOWER(LEFT(A2)), {"r","s","t"}, 0), B2*C2, B2^2, B2*C2/2)

SUMIFS returns 0 using dynamic criteria, with criteria range and sum range on another sheet

Anyone,
I've chatted with and called excel customer service with no luck. I used the formula builder (please see attached screenshot) to make sure each element of the formula is correct and returns the value for the criteria I'm trying to reference.
Everything is accurate, but it returns a value of 0. When I do the same thing in the actual sheet the data is stored in (and click a criteria cell within the criteria range) it returns the accurate value?! I'm not sure why it won't work on the other sheet. The values I am using to select are dynamic and change with a drop down. I have another, advanced, workbook (I did not create) that does the same thing and completes an even more complicated formula, but actually works so I'm not sure why this is returning a 0 value.
Photos and code/syntax: Dynamic Selection, Example 2 of it working, Example 1 of it working, Formula Builder, CountIFs, Advanced Spreadsheet working, VLOOKUP
=SUMIFS('GFEBS Pull'!Q:Q,'GFEBS Pull'!G:G,FMCOP!$C$20,'GFEBS Pull'!H:H,FMCOP!B23)
or:
=SUMIFS('GFEBS Pull'!Q:Q,'GFEBS Pull'!G:G,'FMCOP'!$C$20,'GFEBS Pull'!H:H,'FMCOP'!B23)
When I type ' around FMCOP sheet name, they disappear? I've also tried to lock the columns on the 'GFEBS Pull' sheet with no luck. Cell B23 is not locked because I'm going to copy the formula down to reference other cells. Any help is appreciated!
In this screenshot you can clearly see that both FMCOP!C20 ansd FMCOP!B23 have prefacing spaces; e.g. " HHC".
Since " HHC" will never match "HHC", fix the data returned from 'the lower table in the same screenshot'.
A Text-to-Columns, Fixed Width, Finish should do this. You could adjust the original formula like,
=SUMIFS('GFEBS Pull'!Q:Q, 'GFEBS Pull'!G:G, TRIM(FMCOP!$C$20), 'GFEBS Pull'!H:H, TRIM(FMCOP!B23))
I would caution against the latter 'bandaid' fix. Fix the original data; do not apply bandaids on-the-fly.

Excel Cell reference that will go to the left

I am using an excel spreadsheet formula to add two cells together and I want to have it reference one row from left to right like it normally does, but I need it to reference the same row in another page in reverse, and then be able to drag the formula through the entire worksheet. I cannot seem to find anything like this when I look online. TLDR I need to know how to tell excel reference the cell to the left if I drag it to the right.
so I need to add A0 in page one and A9 in page two then when I copy the formula to the left I need it to grab A1 and A8, is there a way to get this?
Your question is not very clear; for example, you talk about a formula but have an Excel-VBA tag. However, I think I understand the effect you seek.
I have filled A1:I1 of the current sheet and A1:I1 of worksheet “Sheet3” with numbers.
I have typed the following formula into another cell within the current worksheet:
=A1+INDEX(Sheet3!$A$1:$I$1,,10-COLUMN(A1))
The target area for the INDEX function is Sheet3!$A$1:$I$1. This is a one row range so I do not need a row number. The column number is 10-COLUMN(A1) which is 9 so this formula is equivalent to:
=A1+Sheet3!I9
If I copy the formula one cell to the right I get:
=B1+INDEX(Sheet3!$A$1:$I$1,,10-COLUMN(B1))
This is the equivalent of:
=B1+Sheet3!H9
You can continue copying the formula to the right until you get:
=I1+INDEX(Sheet3!$A$1:$I$1,,10-COLUMN(I1))
Attempting to copy further gives an error because 10-COLUMN(J1) is zero and there is no column 0.
There are other methods of achieving this effect. The key feature of any such method is the expression N-X where N is a constant and X gets bigger as the formula is copied further to the right.

MS Excel dynamic print area

I wish to create a dynamic Print_Area in Excel 2010 which will consist of two cell ranges.
For example the first cell range is A1:J50 and the second range is A100:J150. These should print out on two pages, ignoring the cells that come in between these two ranges.
The four cells shown in the above example ranges should be dynamic, and not hard coded as simple Print_Area ranges. Therefore in my worksheet I used cells AA1, AB1, AC1 and AD1 to store values "A1", "J50", "A100" and "J150" respectively.
(The cells AA1, AB1, AC1 and AD1 actually use formulas to determine what cell address will be used, but for this question lets just assume the values are set as above).
I then used the Name Manager and entered the following formula under Print_Area:
=INDIRECT(Sheet1!$AA$1):INDIRECT(Sheet1!$AB$1);INDIRECT(Sheet1!$AC$1):INDIRECT(Sheet1!$AD$1)
The result of this formula is exactly what I need, and it actually works the first time I print the ranges. However once I did that, Excel automatically substitutes the formula with the actual cell range that was calculated. So when I check the Print_Area in the Name Manager after printing once, it contains something like:
=Sheet1!$A$1:$J$50,Sheet1!$A$100:$J$150
Is there a way to prevent the Print_Area from converting my formula to calculated values, and instead using the formula every time I print? I would like to not use macros if at all possible (if not, I'll try macros too)
I tested this and it seemed to work.
Create a new name called Test and set its value to (Note that I used a comma rather than the semicolon you had. I have US language set)
=INDIRECT(Sheet1!$AA$1):INDIRECT(Sheet1!$AA$2),INDIRECT(Sheet1!$AA$3):INDIRECT(Sheet1!$AA$4)
Set your Print_Area name to
=TEST
Good luck!
EDIT
The above works for me, but it appears unnecessary. I just tried to replicate the problem, and was unable. When I have the Print_Area set to the formula with INDIRECT it does not replace after printing.
See this linked file. https://www.dropbox.com/s/pgm0iv19u6igdm5/Book1.xlsx