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

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, )))

Related

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
) & "%"
),"-%",""
)
)

Vlookup - how to deal with #n/a errors - office 365

I'm using MS Excel O365 Business in version 1905 (compilation 11629.20196). In this case i have created two sheets: 1) "Orders"
2) Order_status
NUMBER_ORDER Column (in Order_status sheet) has been created all cells by drop down list giving source to column in "Orders" sheet: =Orders!$B$2:$B$1048576
Now i'd like to create a formula in DESC_ORDER from "Order_status" sheet which automatically writes data from cell in "NUMBER_ORDER" Column. By writing that formula i have "#N/A" Error (despite the correction all data in the 2 sheets).
What I've tried?
I tried in a few different ways:
1) I've written =VLOOKUP(E2,Orders!$A:$B,COLUMN(Orders!$A$2:$A$1048576)) then i formated text to column the DESC_ORDER in "Orders" sheet. It didn't work.
2) Then i tried this VLOOKUP by changing to text in E2 cell: =VLOOKUP(TEXT(E2,"#"),Orders!$A:$B,COLUMN(Orders!$A$2:$A$1048576)). Didn't work too.
3) Then i modified to Trim in E2 cell: =VLOOKUP(TRIM(E2),Orders!$A:$B,COLUMN(Orders!$A$2:$A$1048576)) Didn't help.
4) Later i created 2 views "Orders" for these 2 columns for in "Orders" sheet. And "Orders_status" in columns from "Order_status" sheet. The i rewrote that formula: =VLOOKUP(Order_status,Orders!$A:$B,1,FALSE) and still shows #N/A! Error.
I've been looking for any solution but i haven't still found. Can someone please what should i do? Any ideas? Thx in advance for help or any tips.
Try:
=INDEX(Orders!$A$2:$A$6,MATCH(E2,Orders!$B$2:$B$6,0))
Results:

Excel: Check if value occurs on one of several sheets

I would like to check if the value "x" occurs in the cell A1 on one of many sheets.
Unfortunately, the match formula does not work if I reference to multiple sheets.
=MATCH("x";Sheet1:Sheet2!A1;0)
It would be great if you could help me out on this.
Best,
IF YOU HAVE EXCEL 2016 OFFICE 365, you can use the following formula to return TRUE or FALSE if "x" appears in A1 through multiple sheets:
=NOT(ISERROR(FIND("x",CONCAT(Sheet1:Sheet2!A1))))
This won't work on other versions because the CONCAT function isn't available.
Change < number of sheets > to the number of sheets you have:
=SUMPRODUCT(COUNTIF(INDIRECT("'Sheet"&ROW(INDIRECT("1:"&< number of sheets >))&"'!A1"),"x"))
This requires that your sheets are named "Sheet1", "Sheet2", etc.

Copy and paste columns to another sheet based on a criteria

How do I copy and paste columns from Sheet 1 to Sheet 2 which has the word "To" in its column headers?
Example, Column H Header = 12/2/2014 To 14/2/2014
I want to copy only these types of columns and paste it on another sheet.
P.S. I'm looking for a non-vba solution (if there is one) so any help would be much appreciated.
I've tried using this formula but nothing happens.
=IF(COUNTIF(Sheet1!A$1,"*TO*"),Sheet1!A2,"")
P.S. I'm using Excel 2013.
You can use Find formula that will return the number of "To" for that.
=IFERROR(FIND("To", A1, 1), "Did not found")
And in VBA you can use InStr that does almost the same operation.

excel sheet sub headings as columns

I am totally new to this kind of challenges and not sure any thing available ( not sure even on what base I have to search )
In the below excel sheet image the column 'A' has headings in two places ( row numbers 2,3 and 9,10) . The actual excel sheet has more than six thousand rows and too many sub headings like this ( If it is small file I can do it manually.. but more than 6 thousand rows)
The challenge :- I want to populate E column with "Make" value and F column with " Model" from sub headings . Can I write any rule or macro to populate these columns ? could some one help me ? Thanks for your help
Image Link
or below
Regards
Kiran
If you want to do this solely in Excel you can use the following. This assumes
All Headings are the same for "S.No"
Change the SUBSTITUTE clause to match the text for Make and Model eg I have used exact spacing of "Model: " and "Make : " to match the spreadsheet and substitute with ""
In cell G5 Enter =IF(ISNUMBER(A5),IF(ISERROR(FIND("Model",A3,1)),MAX($G$1:G4),MAX($G$1:G4)+1),"")
In cell F5 Enter =SUBSTITUTE(IF(ISNUMBER(A5),INDIRECT(ADDRESS(MATCH($G5,$G:$G,0)-2,COLUMN(A1),1)),""),"Model: ","")
In cell E5 Enter = =SUBSTITUTE(IF(ISNUMBER(A5),INDIRECT(ADDRESS(MATCH($G5,$G:$G,0)-3,COLUMN(A1),1)),""),"Make : ","")
Then drag down the formula in E5:G5 to wherever you need. However, I only recommend using this once only as the formulae will be slow to update over large ranges. Also if your headings are out of sync then VBA is the way forward

Resources