Using Excel Functions to Get Data into a Single Cell - arrays

I'm working with the Bloomberg Add-in on Excel to gather some data. The problem I'm having is to get all the data into a single cell. For instance, I want to get the daily change % for the past 5 fives for IBM. The formula I am using is:
=BDH("IBM US Equity","CHG_PCT_1D","11/9/2012","","Array","TRUE")
I made this using the Formula Builder, so I'm not sure why this isn't working. It returns error message: "#N/A Invalid Parameter: Invalid Override Field ID Specified"
If I exclude the whole array part, then it returns the data I want but in 1827 or so different cells. Any way I can get all of these in one cell?
Thanks

Use the working method that fills cells A1 through A1827.Then in cell B1 enter:
=TEXTJOIN("",TRUE,A1:A1827)
This cell will contain all the data you require.

Related

Google Sheets: Sum, Query, other Formulas Treating Values (Formatted as NUMBERS) as Zeroes in Formulas - Unclear why

I have 15 Google Workbooks that import into 1 Workbook tab through an Importrange + Query combo function. The data is then queried and transformed across several other tabs, but the problem definitely begins on this tab.
Although I've manually forced a format change to "Number" in each workbook source AND in Columns CO:CQ (where the problematic data lands), all functions see the data as zero or null. Here is what happens when I set a random cell (CW33) equal to a cell in one of the trouble columns (CO33)
However, when I wrap the cell in an =sum(), the workbook returns "0":
I have no idea how to force the workbook to see the values in these rows as numbers without creating an entirely new column - does anyone have any ideas on how to fix it while preserving the column structure?
Thanks!
try:
=SUM(CO33*1)
for multiple cells it would be:
=ARRAYFORMULA(SUM(CO33:CO34*1))
or:
=SUMPRODUCT(CO33:CO34)
AFAIK, in Sheets, a Number formatted cell displays contents right-aligned and Plain-Text are left-aligned. The highlighted cell looks like a text cell.
Try changing the format of cell or column manually to 'Number' from the 'Format' tab.

How do I get value of an indirect formula into a format that can go into an array?

My Google Sheet that will be updated over time with new sheets. On my dashboard/master sheet, I can write a simple INDIRECT that will pull information from a cell in the sheets. However, the formula does not replicate its way down the column. I understand that I need to use an ARRAYFORMULA to get the auto formula placement done.
I've tried many ways but the one that I think may get me there is to use CONCAT. My columns look like this:
Event Title [uses a script to pull in the names of all the sheets]
Use an array to get the titles so they pre-poluate down the column so I can use it later: =ARRAYFORMULA(IF(Row(A:A)=1,"Get Title from A",IF(ISBLANK(A:A),"",A:A)))
-- The Event Title is now appearing as plain text in Column B.
I then use CONCAT to write the part of the formula I need to help get the name of the INDIRECT in without using the INDIRECT formula.
=CONCAT("'"&B5&"'"&CHAR(38)&"!"&"""","B2"&"""")
-- This gets me this result: 'Computers 101'&"B2"
At this point, my hope is that I could then use this information ('Computers 101'&"B2") into an ARRAYFORMULA. I used this formula to try and do that:
={"Event Date";ARRAYFORMULA(A6:A+D6:D&"Cat")}
-- I get the answer: 0
The expected value was the date cell (B2) in the Computers 101 sheet. Any ideas how to proceed? I don't know the names of the sheets in advance.
unfortunately, this is not possible within of scope of google sheets formula. if you need ranges from other than the actual sheet you need to use INDIRECT which is not supported under ARRAYFORMULA.
you have 3 options:
hardcode it like: https://stackoverflow.com/a/68446758/5632629 with IFERROR & array of empty cells to match columns of your range
generate formula which will generate your final formula/range as a text string and then use a simple script to convert that string into the valid formula: https://stackoverflow.com/a/61819704/5632629
do it all with scripts

Excel - dynamic data validation lists for multiple rows

Excel 16.x for Mac
I have a situation where we have a tabular spreadsheet template for requisitions. The spreadsheet is copied for each project and filled out. Each spreadsheet will have multiple rows - from 1-400. Each row has columns with data validation rules.
The issue is that I cannot figure out how to enter a formula that generates a different list for each row the data validation formula entry.
eg:
Each row will have a "Facility Code" and a "Building Code". The "Building Code" list is generated by what is in the "Facility Code" cell. The problem is that the data validation rule wants a range of cells, not a formula that generates an array. With sometimes 400 rows, I would need to create 400 different lookups based on the R(n):Facility_Code entry.
Dynamic List for Facility Code (in Template!P4):
=UNIQUE(FILTER(NFS_Facilities[Facility Code],(NFS_Facilities[Facility Code]<>""),""))
Dynamic List for Building Code:
=UNIQUE(FILTER(NFS_Facilities[Facility Code],(NFS_Facilities[Facility Code]='Template'!P4),""))
The P4 is the issue here as it will change by the row.
The Data List validation points to a range of cells.
The current behavior is on R1, it works fine. On R2, no matter what is entered into "P5", it generates the data based on P4 (as it should as that is what is in the formula).
Is there any way to have the Data Validation formula be dynamic based on the R(n)? The intent is to have the Data Validation range be a dynamic formula replacing P4 with tableName[facilityCode]
...Ignore my previous answer.
Putting a FILTER isn't going to work inside a DV with a dynamic reference for some reason.
You'll need a hidden sheet, and in that sheet each row on the input sheet will have a corresponding row of options. They key is to use =TRANSPOSE() around the FILTER() to make the results in rows not columns (so they don't cause #SPILL! errors.
Once you have that setup, just point the DV to the sheet with a spill reference (with a # behind it): example in Sheet BUILD_CODE_OPTIONS!A4:
=TRANSPOSE(UNIQUE(FILTER(NFS_Facilities[Facility Code],(NFS_Facilities[Facility Code]='Template'!P4),"")))
then in the DV for the Building Code field on row 4:
BUILD_CODE_OPTIONS!A4#
You'll need a sheet for every column you want a dynamic drop down in.
... now just waiting for MS to fix the bug preventing the FILTER in the DV ...

IF formula do not return anything

I have a Google sheet where I receive the data automatically from a software. Basically it adds a new row and with data in each column. Now I have to add manually a column and I want to add a formula to each new row. I'm using IF to leave the cell blank if G1401 is empty.
=if(G1401="", , ifna(CONCATENATE(G1401," - ",H1401," - ",J1401)))
But i have to drag the formula for the cells I want and thats THE problem. If I drag the formula, when the software sends a new row, it's assuming that I already have a row filled with a formula and write in the next one without the formula.
What I want is something similar to FILTER function to be able to not use the drag cell formula to use it or something similar.
use in row 2:
=ARRAYFORMULA(IF(G2:G="",, G2:G&" - "&H2:H&" - "&J2:J))

VB.Net - Excel application get showing values of an range

I'm trying get an Excel Range and copy into an array of objects with Vb.Net.
This is not a problem. I use the following code:
Dim vValues(,) As Object = ExcelApp.Range(vRange).Value
And works fine; but I have a the following case:
In the column "C"; the value has a specific format and internally has another value.
My question is:
Somebody know the way to get the information exact as the user see?
I'm trying to get the information without use a For ... Each or some kind of cycle.
I'm also tried to avoid use "text to columns" function.
Both seems right solutions, but would impact the performance with a lot of data.
FYI: Also I can get the information through the ODBC connection; but I'm searching the solution using a Range
Exactly what the user sees is the Text property. But you cannot have an array of that, you will have to query each cell individually.
You are getting a Double value in your array instead of a DateTime value because you have "Time" formatting applied in Excel. If you had a format from the "Date" category, Excel would instead send a proper Variant/Date, not a Double that represents it.
Another option would be constructing the DateTime objects on the .NET side, provided you know in which columns they should be.

Resources