I have a dynamic formula in google sheet that splits a rept string into multiple columns using this formula: =split(rept(A1,B1)," ").
But I can't seem to figure out how to do this in excel. Any suggestion would be helpful.
https://docs.google.com/spreadsheets/d/1IcIvhuwA3z2lngz-l4TwuenPgCMOGdCwe_Ukhu_f5zQ/edit?usp=sharing
If you have SEQUENCE() function access then try-
=TRANSPOSE(INDEX(A1,SEQUENCE(B1,,,0)))
You could use FILTERXML() to mimic a split funcitonality:
Formula in A3:
=TRANSPOSE(FILTERXML("<t><s>"&REPT(A1&"</s><s>",B1)&"</s></t>","//s[.!='']"))
The above will spill the returned array horizontally using Microsoft365. If you don't have acces to dynamic array funtionality, you could use indices to return values from the resulting array.
For further explainations and examples using FILTERXML() I'd like to refer you to this Q&A on the topic.
Related
How to text join all negative value references?
Using textjoin function or any other function in Excel. (without VBA code)
You can use formula suggested by JvdV. You can also try TEXTJOIN() with FILTER() formula.
=TEXTJOIN("|",TRUE,FILTER(A2:A7,C2:C7<0))
So, had a quick play and this works:
Only did the first 3 but if() and iferror() or isblank() come to mind if there is only one, two etc results to avoid repeating | without names...
Note, the formula shown in C1 should be SMALL(... not LARGE(...
In Excel 2013 I need to have the content of the cells on the array A9:E18 listed in the cells from H1 to H10 (because I already know that there will always be exactly 10 non-blank cells in that array, the rest of them being empty).
I cannot find a proper formula to have it done.
Could anybody help me, please?
I would suggest you to use FILTERXML() with TEXTJOIN() function. Unfortunately Excel2013 doesn't have TEXTJOIN() function. You can use a custom TEXTJOIN() function from this article TextJoin UDF For Excel 2013
of #Scott Craner answer. Then use FILTERXML() like below.
=IFERROR(INDEX(FILTERXML("<t><s>"&TEXTJOIN("</s><s>",TRUE,$A$1:$E$18)&"</s></t>","//s"),ROW($A1)),"")
With Excel365 you can simply use-
=FILTERXML("<t><s>"&TEXTJOIN("</s><s>",TRUE,$A$1:$E$18)&"</s></t>","//s")
I can't figure out how to make an array formula with a SUMIFS function.
I want my results from SUMIFS to be ponderated by a ratio.
See atatched example file.
Have a nice week-end!
Nicolas
Here follow a link to the example: enter link description here
You can't use an array in SUMIFS.
Use SUMPRODUCT:
=SUMPRODUCT(F4:F16,G4:G16,(C4:C16=K4)*(D4:D16=K5))
Similar questions to this have been asked but not exactly like this. There is one that is very close, but that solution is not working for me.
I have a function which returns comma separated values into a cell. I would like to pass the elements in that cell as criteria to a SUMIFS function using an approach like this one.
My attempt is pictured below:
I believe that this is somehow tied to the way that the function is understanding what is in cell G8. It looks like it is adding some extra quotes. If I highlight G8 in the formula bar and press F9, I get:
There are extra quotes on each side of each criteria.
I am open to a custom VBA function solution, but I would prefer something which can be built as a worksheet function. The criteria are returned from a custom VBA function that pulls elements out of a list box and does some regex work to remove extra commas. The number of elements that can be selected is variable so I would like to avoid having to split the criteria into more than one cell. Thanks.
Seems that the raw comma-separated criteria is in G6, All you need is to split this criteria into an array and feed it to SUMIFS. Splitting is available in VBA, but not exposed to Excel. All we need is to write a little UDF that does the splitting of the CSV and use it in our formula:
Function splitCSV(str As String)
splitCSV = Split(str, ",")
End Function
Now the formula in F10 would be:
=SUM(SUMIFS(C3:C10, B3:B10, "blue", A3:A10, splitCSV(G6)))
EDIT
The above is an array formula (Ctrl+Shift+Enter). To have it a normal formula we can use SUMPRODUCT instead of SUM. This leads to more flexibility (normal formula vs array formula) as well as some "expected" performance improvement.
=SUMPRODUCT(SUMIFS(C3:C10, B3:B10, "blue", A3:A10, splitCSV(G6)))
I'm trying to utilize the syntax for OR like criteria for a COUNTIFS function in Excel. However, when trying use cell references, it just tells me
There is a problem with this formula
Function: =SUM(COUNTIFS(rosterTable[lastDayWithClient], {">="&A7,""}))
Specifically if I'm trying to use &A7 to concatenate the criteria with a cell value, it fails.
">="&A7 is not an allowed entry in an array constant.
Per Excel Help: Array constants can contain numbers, text, logical values (such as TRUE and FALSE), and error values.
As #ScottCraner indicated, you can accomplish the same by summing separate COUNTIF functions. The AGGREGATE function, or various types of SUMPRODUCT implementations may also provide a solution.