I’ve got Google form survey data I’d like to analyse. In my example doc,
Sheet 1 contains the survey responses and sheet 2 references the data in sheet 1. Sheet 2 is where I am using this array formula under the column called Behaviour:
=ArrayFormula(if(len(A3:A),if(Sheet1!Question3="Yes","Excluded ",)&if(Sheet1!Question5="Yes","Arrested ",)&if(Sheet1!Question6="Yes","Alcohol ",)))
The issue is that I need to be able to download this Google spreadsheet as a Microsoft Excel doc but whenever I do that, of course the Google spreadsheet =ArrayFormula() function is not supported in Microsoft Excel.
My question is how could I replicate this array function’s behaviour using another method in Google spreadsheet so that I get the same result when it’s downloaded to Microsoft Excel?
What I’ve been able to find in the forum so far are questions on how you can manually copy formulas to multiple rows in Excel. The trouble with these methods are that the user has to do it by either clicking and dragging the bottom right-hand corner of the cell or by using shortcuts. I’d like my process to work so that the user doesn’t have to manually do anything.
Many thanks in advance.
Excel support array formulas but it does that in a different way than Google Sheets.
Instead of an ARRAYFORMULA function, Excel requires that the formula autor/editor, first selects the area to which the array formula result should be extended, then enter edit mode and press CTRL+SHIFT+ENTER. See Create an array formula that calculates multiple results on Create an array formula
It is possible to replicate the Google Sheet ArrayFormula in MS Excel using the OFFSET() formula even if it's not as simple as the ArrayFormula function.
The full documention of the function can be found here.
https://support.office.com/en-us/article/OFFSET-function-C8DE19AE-DD79-4B9B-A14E-B4D906D11B66
A quick example
Google Sheet
= ARRAYFORMULA(SQRT(Sheet2!A:A))
=> This will copy the full column A for the Sheet2 taking the square root of each value.
Excel Version
= SQRT(OFFSET(Sheet2!A1,0,0,COUNTA(Sheet2!A:A),1))
=> This will take a reference of the column, but we have to manually specify the height and width of the reference before taking the square root of each value.
You may very well discover that this is not possible; at least not in every case. There may be a few formulae which have the exact same definition in Google sheets and Excel. however, it's not guaranteed to work in general.
Some more detailed information here: Sheets vs Excel forumlae
Related
I'm attempting to design a macro to simplify the update process for my company's order tracking, and I'm struggling with relative references. I'm using Excel 2010.
what I need the macro to do: Find a given part number on one workbook, and use the row number of to update formulas in a a second workbook.
In more detail:
Where |Y|= column letter of original spreadsheet, |X|= row number of original spreadsheet, and |X^|=Row number of ‘All Inventory.xls’
There are 4 separate spreadsheets I would need to run the macro from (It’d be a lot easier if I could have the 4 as separate pages on one spreadsheet, but unfortunately, my boss is 60 and is a bit fuzzy on how excel works.)
The spreadsheet ‘All Inventory.xls’ is not in table form, and I can’t convert it to one. (the guy who runs inventory is very fuzzy on how spreadsheets work, approximately five years from retirement, and about as friendly as a snapping turtle.)
When run from cell |Y||X| in a table:
Copy content of the cell in table column ‘Part #’ in the same row – structured reference [#[Part #]]|X|
Paste content of cell ‘[#[Part #]]|X|’ into Find/Replace
Switch to spreadsheet ‘All Inventory.xls’
Hit ‘find next’ – will land on cell C|X^|
switch back to original spreadsheet
return to original cell |Y||X|
type “=’[All Inventory.xls]Sheet1’!$E$|X^|”
go to cell |Y+1||X|
type “=’[All Inventory.xls]Sheet1’!$G$|X^|”
go to cell [Y][X+1]
End macro
I've tried recording this directly, while using relative references. Excel didn't like that. I'm not sure where to go from here.
I've been saving Google Sheets to Excel without any problems for a while. These sheets have always successfully saved and opened in Excel with the importrange function. However, recently it hasn't been successfully saving correctly.
It used to just have the static value (e.g, 40). There used to be an IFERROR in the first cell in the header row but now it exists in every single cell.
E.g, each cell would have something like this:
=IFERROR(__xludf.DUMMYFUNCTION(importrange(blahblah)),"40").
DUMMYFUNCTION throws an error and "40" is returned as a result. but "40" is a string, not an integer which messes up all my formulas.
I also know this isn't an Excel issue because OpenOffice is doing the same thing with the file.
I'm pretty sure this would be a bug because why would it be working for months and then suddenly stop working?
What should I do?
I'm thinking it's a bug too.
Workarounds
On Excel
Copy and paste as values only the ranges with IFERROR(__xludf.DUMMYFUNCTION(..., then use Excel's UI tools to convert numbers shown as text to numbers.
Selectively remove quotes on the IFERROR second argument of the cells causing problems
Remove =IFERROR(__xludf.DUMMYFUNCTION(),"value") except value (we could use Excel's built-in FIND & REPLACE for this)
On Google Sheets
Use Copy > Paste as values only on the range areas having formulas with non-compatible functions like IMPORTRANGE, QUERY, FILTER, etc.
If you only need the values, download it as CSV instead of XLSX
IMPORTANT
In order to help to prioritize this issue, send feedback to Google. To do this open a Google Sheets spreadsheet, click on Help > Report a problem, then fill the feedback form and submit it.
Related stuff
I posted 5 small articles about this in Spanish. You could find them listed on https://www.rubenrivera.mx/p/descargar-hcg-excel.html.
We accidentally created a workaround for this bug with a different sheet that was just set up like this.
This works when you IMPORTRANGE into another Google Sheet. We are doing it into a Google Sheet with a single worksheet - haven't tried it with multiple.
It's going to sound a little nuts but it works for us.
In the first cell of your import range put a hyperlink in the original document you are importing from. This is in the first cell of the import range. We linked it to a worksheet in the original document. It has worked and failed with an external link. With an external link it worked when I linked it to an internal link, then changed it. But when I deleted the cell and just straight linked it to an external URL it didn't work.
Then #timbo was right - put data validation in. This can be in part of the document that isn't being imported into the second sheet. I put it in the first line of the import range but outside what I was importing. It might have to be the first line. I just put a date in one cell, then in the next cell data > data validation > then choose that one date as the data range.
For aesthetics I have hidden the first row in one Google Sheet I am importing into. In another I made the first cell link the title of the sheet and put the data validation outside the import range. Both of these work.
Let me know if this works for you.
Until this bug is fixed, a workaround is to put a data validation (Data > Data Validation) on the imported data (Any kind of data validation will do).
I'm resurrecting some old scientific data from the early 2000s.
I need to locate the custom functions that allowed the data to be shown. The spreadsheet that I have is full of #REF! cells, as they are supposed to be calculated based on a custom-defined formula (here, called 'RESECTION').
How do I find this formula? If I can see the math it was performing, I will be able to use this old data, and extend our timeseries significantly.
The spreadsheet is an ".xlsm" document. There is an associated file that is ".XLM"; it provides some GUI-like functionality that is now broken, and I do not see how to access the commands (?) or other VBA that is inside.
I have not had success with this solution.
File with the VBA can be found here; SURVEY.XLM.
Problem is seen here; calling function from SURVEY.XLM. How do I access the formula within here?
I can see that the formula is in there; how do I see the calculation it performs?
RESECTION is a named range refering to cell A4 on the hidden Survey sheet.
In the VBE immediate window type thisworkbook.Sheets(2).visible = true and then thisworkbook.Sheets(2).select.
Cell Survey!A4 contains the value =RESULT(64).
The rest of the sheet contains the macros - first time I've seen or tried to use a filled in macro sheet.
I tried Ctrl+Fto find the definition of RESULT but it comes up with Macro error at cell [SURVEY.XLM]SURVEY!A364.
Some formulas I'm using only work in Microsoft Excel but not Google Sheets, or a different formula that has the exact same result works in Google Sheets but not Microsoft Excel.
Is there a simple way to detect if Google Sheets or Microsoft Excel is running, and execute the compatible formula accordingly?
I am finding it difficult to believe this question hasn't been asked before but I couldn't find my specific question of the same file working in both Excel and Google Sheets.
I'm not concerned about scripts, just formulas.
There is no official way to determine if Microsoft Excel or Google Sheets is running through formulas, however with some versions of Excel =INFO("RELEASE") will return the version of Excel running, but this doesn't work in Google Sheets.
Thanks to #Slai, =ISERR(-"1pm") results in TRUE in Excel and FALSE in Google Sheets. Excel doesn't understand how to apply math to a time string value, where Google Sheets does, hence the error.
A simple IF statement using this logic can be =IF(ISERR(-"1pm"),"MS-Excel_formula","G-Sheets_formula")
If the formula you're using returns a number, a more simplified version is =IFERROR(GoogleFormula+"0am", ExcelFormula) however this won't work for non-numeric returned formulas because it adds 0 to the result which should not change a numeric result. For instance, =IFERROR(1+"0am", 2) returns 1 in Google Sheets and 2 in Excel.
If Microsoft decides to recognise "1am" or "0am" as numeric time values in future versions of Excel, the above if statements won't work as intended and Excel will attempt to execute the Google Sheets formula.
One boolean solution is to force an error in a function you absolutely know doesn't work in one or the other program. So #Slai 's example would work well no? Also, excel doesn't attempt to implement the Google only functions like ArrayFormula or Importrange &c. FWIW The minor discrepancies are the ones that catch me out - 'DSUM' for example frustrates me in that Google Sheets responds slightly differently to the Excel implementation under certain conditions. There will be others I'm sure but I've not yet found a definitive list or collation thread of these. (PS. I've not expanded my description of the DSUM idiosyncrasy as I suspect it'll be too far off topic).
I have a spreadsheet where I am populating a cell in a worksheet with a drop down list using Data Validation, with a Named Range as the source. The Named Range is based on a worksheet called Services, where the data starts in the second row, the first row being headings.
This works fine where the name has been defined using the following formula:-
=OFFSET(Services!$A$2,0,0,COUNTA(Services!$A:$A),1)
However, the list is not alphabetically sorted, and all the formulas I have come across on the internet have not achieved this for me.
One site offers a solution which says
If you can handle extreme formulas, here is an all-in-one formula…
However, when I attempt to paste this in to the “Refers To” box when defining the name, it won’t paste (no error message). At first I thought this was because the formula was too long (about 360 characters) but I understand Excel 2003 should handle formulas that are 1024 characters. So I am a bit stuck and would appreciate any suggestions.
I am working for an organisation which is still using Excel 2003, with no immediate prospect of an upgrade.
I think you may be hitting a version limitation (works in Excel 2013) but in any case that name may not help because Data Validation requires a delimited list, or a reference to a single row or column and I think your formula does not provide that.
However, you should be able to create the sorted version with your formula and then name the range that populates - using that Name for your List Source: in Data Validation.