Formula conversion from Google Sheets to Microsoft Excel - excel

I am using 2 formulas for finding only duplicate values and listing them in another sheet. But when I downloaded the Spreadsheet as Microsoft Excel (xlsx), QUERY formula and Array function dont work on Microsoft Excel.
So I need your help about Microsoft Excel.
This is my formulas using on Google Sheets. How can I do that on Microsoft Excel? I am open to another formulas or solutions.
=INDEX( QUERY( QUERY( {'DATA'!A2:A}, "SELECT Col1, COUNT(Col1) GROUP BY Col1 ORDER BY Count(Col1) DESC"), "WHERE Col2 > 1",0) ,,1)
Test sheet:
https://docs.google.com/spreadsheets/d/1QJ7OLlrDg_9cZjwZFXjVFo0NHB6QvHl8MszQTYf4w2I/edit#gid=1428898146

With your shared example:
=UNIQUE(FILTER(DATA!A:A,COUNTIF(DATA!A:A,DATA!A:A)>1))
But this will be real slow, because it calculates each row of column A, also the empty ones.
To workaround we can use:
=LET(data,FILTER(DATA!A:A,DATA!A:A<>""),
u, UNIQUE(data),
FILTER(u, MMULT(--(TRANSPOSE(data)=u),SEQUENCE(ROWS(data),,1,0))>1))
In this case we can't use COUNTIF, because this requires a range, but using LET converts it to array. Therefore MMULT can be used.

Assuming data has a header, you can also use frequency:
=LET(data,DROP(TOCOL(Data!A:A,1),1),
u,UNIQUE(data),
f,DROP(FREQUENCY(data,u),-1),
HSTACK(FILTER(u,f>1),FILTER(f,f>1)))
If hstack is not available, you can try:
=LET(data,DROP(TOCOL(Data!A:A,1),1),
u,UNIQUE(data),
f,DROP(FREQUENCY(data,u),-1),
CHOOSE({1,2},FILTER(u,f>1),FILTER(f,f>1)))

Related

MS Excel, G Sheet, count multiple condition with OR logic

Says I have some data, and I would like to count if it was "CC" or "DD". Here's what I did in Microsoft Excel and Google Sheet.
=sum(countifs(A2:A10, {"CC", "DD"}))
In MS Excel, it seems ok, but not in G Sheet.
I have to do this in G Sheet to get same result:
=countif(A2:A10, "CC") + =countif(A2:A10, "DD")
Any smarter way to do this in G Sheet ?
My sample :
This is an array formula.
In Google Sheets: =arrayformula(sum(countifs(A2:A10, {"CC", "DD"})))
In older versions of Excel, you would have had to confirm this with Ctrl+Shift+Enter. It is also an array formula.
use in Google Sheets:
=ARRAYFORMULA(SUM(IF(REGEXMATCH(A:A, "CC|DD"), 1, )))

How do i do a index match split and concatenate multipul IDs in a cell in google sheets?

Hey all please help me i need your help with something i been breaking my head on
basically lets say in google sheets i have a list of products and each product has an ID
when making me sheet i have boxes that contain more than 1 product so in a single cell there is for this case 3 different ID codes displayed like this (eg: 087345-080046-083823)
i need to some how in the column in another sheet state what the products are for (eg:Shirts-shoes-shorts) so whet im looking for that i cant find anywhere is a formula like
=Index(split()match()concatenate())
Thanks.
This formula solution work in Excel sheet for the Office 365 version due to the using of TEXTJOIN function.
In E2, enter array formula (Ctrl+Shift+Enter) :
=TEXTJOIN("-",1,IF(ISNUMBER(MATCH(A2:A10,0&FILTERXML("<a><b>"&SUBSTITUTE(D2,"-","</b><b>")&"</b></a>","//b"),0)),B2:B10,""))
You said that in google sheets you have a list of products, so below is formula in google sheet. Assumption data in E1:E2 and master in A2:B4, then:
= arrayformula
( substitute
( transpose
( query
( transpose
( vlookup
( split ("'" & substitute(E1:E2,"-","-'"),"-",true,true) ,
ProdMaster!A2:B4,2,false
) & "-"
),"Select *",1000
) & "%"
),"-%",""
)
)

Create dynamic search box instead of Ctrl + F

I’d like to create a dynamic search box at the top of my master sheet (Sheet 1) instead of using the “Find” command, Ctrl + F. It would search column B and output info from the corresponding cell in column C.
The search box/cell would be dynamic, so as I type into it, it would pre-populate from a master list (Sheet 2), without having to hit ENTER or an OK button.
I’d like the search box/cell to be in A1
I’d like it to search column B data. From B2 to the end (row can change): B2:B
The result would be the data in column C:C2:C
Not sure if I should use the QUERY or ARRAYFORMULA function. Appreciate any thoughts on how to set this up.
how about this:
=JOIN(CHAR(10), QUERY({B2:C}, "select Col2 where Col1 contains '"&A1&"'", 0))
demo spreadsheet
I think I figured it out!
Sample Sheet
Search Box (A1): I used Data Validation. It is dynamic as I type and lists the master list of items in column A
Search Results (B1): I used VLOOKUP
Thanks, #player0, for suggesting the data validation! Really helped :)
Only issue is that I sometimes have multiple values in Column B (Item). For instance, I have "lemon" listed twice. I'd like the output in B1to show all other results. They can show in B2...Any suggestions?
EDIT: For the issue of multiples in column B, I decided to change all items in Column B to a unique identifier.
paste this in C2 cell:
=QUERY({B2:B}, "where Col1 contains '"&A1&"'", 0)
and set up dropdown data validation from B2:B range in A1 cell
demo spreadsheet

Export a List&Label table with formula to Excel

I have an existing List&Label report containing a table with three columns:
col1 = valueA
col2 = valueB
col3 = valueA + valueB
When exporting these list to excel, the resulting excel table contains only values in all three columns.
Example export:
I tried to enter the formula for col3 as text, but then Excel also interpreted it as text.
Is there a way to export the table with List&Label to Excel, so that I have a working formula in excel?
Unfortunately - no. As List & Label has its own formula language that isnt't entirely translateable to Excel, there is no layer for this purpose - all values are exported as is. I'd export just columns A and B and add the formula to the resulting sheet. If this is something you need to do often/automatically, you could use VBA to post process the sheet. Here is a primer how to do that.
I'm new to List & Label and I'm evaluating it currently for further use. While my research to the product I found this article which describes new feature within the export format to Excel and meanwhile formulas are supported in the latest version - look there: Generating Excel Formulas in Worksheets

Excel - Pivot Table - Formula Sum a cell only if other cell fulfill an specific value

I trying to create a Pivot Table on Excel with certain formulas. One of them should sum(montant emission) only if off/online = 'OFFLINE'
For example if I group by Code agent, I only want to sum(Montant emission) if 'Off/Online' = 'OFFLINE'
In this case the sum for Code agent = CHO should be 0 and for Code agent = JGR should be 137.5
I need to create a formula that do this calculation. Which formula should I use on "Calculated Field"
Use
=SUMIF(I:I,"OFFLINE",E:E)
assuming that I is your Off/Online column, E is the column with the value you want to sum up.
You can also make "OFFLINE" dynamic and refer to another cell.

Resources