Excel Formula for the below - excel-formula

Please help me know the formula for below,
if the input is,
Header1 Header2 Header3
ABC DEF Yes
ABC DEF Yes
ABC GHI No
ABC GHI No
ABC GHI No
ABC GHI No
ABC GHI No
ABC GHI No
ABC GHI No
ABC JKL Yes
Then the output should be
Yes 2
No 1
We have to calculate Yes and No basis the uniqueness of Header 2, for eg: DEF is written twice so Yes counter is 1, then JKL has Yes, which makes Yes - 2. Similarly GHI is written once in header 2, so the counter of No is 1

Try this array formula in the cell where you want the answer presuming your data headers are in row 1 and the data starts in Cell A2 and ends in Cell C11:
=SUM(IF(FREQUENCY(IF(C$2:C$11="Yes",IF(B$2:B$11<>"",MATCH(B$2:B$11,B$2:B$11,0))),ROW(B$2:B$11)-ROW(B$2)+1),1))
When you have it typed in, press Ctrl+Shift+Enter keys at the same time. That will put the { and } brackets into the formula. Typing the brackets will not work since it is an array formula.
Simply change out the "Yes" with "No" for the no responses.

Related

Conditional formatting comparing tables for missing rows and/or changes

I'm being dumb here. I don't know what I'm forgetting.
I have two tables on two sheets with similar structures. I would like to have the following conditional formatting rules: -
By matching on the first three columns, highlight cells in those three columns in Sheet1.Table1 that do not exist in Sheet2.Table2.
By matching on the first three columns, highlight cells in column four in Sheet1.Table1 that has a different value to that in Sheet2.Table2. The row must be in both tables.
The tables are sorted differently so I can't do a simple cell=cell comparison. I tried using the MATCH function, i.e. MATCH(blah)=0, but that didn't seem to do anything. I will eventually like to do this in VBA, but for now I just want to get the formulas correct and then I can write the code.
Basic example data below: -
Following formatting rule 1 then the cells of Table1 in rows 3 & 4 within Column1:Column3 would be highlighted.
Following formatting rule 2 then the cells of Table1 in rows 1 & 6 within Column4 would be highlighted.
Table1
Column1
Column2
Column3
Column4
Column5
asd
1qa
abc
Yes
blah
qwe
2ws
xyz
No
foo
zxc
3ed
def
Yes
blah
qwe
4rf
ghi
Yes
foo
asd
2ws
ghi
Yes
blah
rty
2ws
abc
No
foo
Table2
Column1
Column2
Column3
Column4
asd
1qa
abc
No
qwe
2ws
xyz
No
asd
2ws
ghi
Yes
rty
2ws
abc
Yes
Thanks in advance.
For the first part of the question, you can use Countifs (or Match if you prefer) but must use Indirect for each table reference:
=COUNTIFS(INDIRECT("Table2[Column1]"),INDIRECT("Table1[#Column1]"),INDIRECT("Table2[Column2]"),INDIRECT("Table1[#Column2]"),INDIRECT("Table2[Column3]"),INDIRECT("Table1[#Column3]"))=0
Similarly the second part formula would be
=COUNTIFS(INDIRECT("Table2[Column1]"),INDIRECT("Table1[#Column1]"),INDIRECT("Table2[Column2]"),INDIRECT("Table1[#Column2]"),INDIRECT("Table2[Column3]"),INDIRECT("Table1[#Column3]"),INDIRECT("Table2[Column4]"),"<>"&INDIRECT("Table1[#Column4]"))>0
EDIT
This is a bit tedious, but you can avoid the indirect by defining the structured references in the name manager (mentioned briefly here)
e.g.
T1C1R2 is defined as
Table1[#Column1]
and T2C1 is defined as
Table2[Column1]
so the first formula becomes
=COUNTIFS(T2C1,T1C1R2,T2C2,T1C2R2,T2C3,T1C3R2)=0

Excel split cell

I'm trying to split the below data in EXCEL but unable to get the required result.
A
B
C
ABC Abc
ABC
Abc
BCD Bcd Cde
BCD
Bcd Cde
CDE EFG Cde
CDE EFG
Cde
Colum A to be splitted as mentioned in B and C column
B Column will have data of all capital words before space of capitlize word
C column will have Cap words
The array formula in B1 below
is
=LEFT(A1,AGGREGATE(15,6,FIND(CHAR(96+COLUMN(A1:Z1)),A1),1)-3)
and the array formula in C1 is
=MID(A1,AGGREGATE(15,6,FIND(CHAR(96+COLUMN(A1:Z1)),A1),1)-1,LEN(A1)-LEN(B1))

excel vlookup with multiple criteria

Table 1 Table 2
A B C D
abc 9 abc No
hij 0 def yes
hij No
input output
abc 9
def #N/A
hij No
I have two tables. If the value exists in column A and the lookup value is greater than 0, then lookup in Table 1, else lookup in Table 2.
I have tried with the formula:
=IF(OR(ISERROR(VLOOKUP(A7,$A$2:$B$4,2,FALSE)),ISERROR(VLOOKUP(A7,$A$2:$B$4,2,FALSE)=0),VLOOKUP(A7,$A$2:$B$4,2,FALSE)=0),VLOOKUP(A7,$D$2:$E$4,2,FALSE),VLOOKUP(A7,$A$2:$B$4,2,FALSE))
Thanks for any help.
use this formula:
=IF(IFERROR(VLOOKUP(A7,$A$2:$B$4,2,0),0)>0,VLOOKUP(A7,$A$2:$B$4,2,0),VLOOKUP(A7,$C$2:$D$4,2,0))

Excel concatenate the column based on other column

I have data in excel like this
A B C
p1 ABC 2
p2wt ABC 3
p3 EFG 1
p3wtke EFG 1
p9r EFG 2
I'm trying to sum up C column if B column has same data and concatenate A column data. And data looks like
A B C
p1-p2wt ABC 5
p3-p3wtke-p9r EFG 4
I tried using =SUMIFS(C1:C5,A1:A9,B1) but it is giving #value, and how do i concate A? I tried Excel concatenate, but is A2>A1 in this link is for number fields?
Use a helper column.
In D1 put:
=IF(B1<>B2,A1,A1&"-"&D2)
Then copy/drag down the data set.
The in another column create a list of the unique values in column B. I put mine in G.
Then in F1 I put:
=VLOOKUP(G1,B:D,3,FALSE)
And in H1 I put:
=SUMIF(B:B,G1,C:C)
Then copies/dragged down.

Find values on two colums on different sheets that don't match

I have two worksheets, both have a column called part number. I need to find only the rows from both sheets that are unique. So if sheet one has:
part number
------------
abc
def
ghi
jkl
and sheet 2 has:
part number
------------
abc
def
ghi
zzz
I need the results to be:
jkl
zzz
You could copy both lists to be in the same column and then advanced filter for unique values
in sheet #3 column A paste the following
=IF(ISERROR(VLOOKUP(Sheet2!$A1,Sheet1!$A$1:$A$4,1,FALSE)),Sheet2!$A1,"")
and in sheet #3 column B
=IF(ISERROR(VLOOKUP(Sheet1!$A1,Sheet2!$A$1:$A$4,1,FALSE)),Sheet1!$A1,"")
that will list values from sheet1 not found in sheet2 and vice versa.
hope that helps
A formula of this kind in each sheet (copied down to suit) should identify uniques with #N/A:
=MATCH(A2,Sheet4!A:A,0)

Resources