i have 3 columns in excel sheet.Let it be A B C. In A column it contain some values Y,Y,Y,N,N,Y..... similarly in B column it has values like Y,N,Y,Y.....
My aim is to fill column C using condition If A Contains Y and B contains Y then C will be S1,S2. If A Contains Y and B Contains N then C will be S1. If A contains N and B contains Y then c will be s2.
I guess this is what you are looking for:
=IF(A1="Y",IF(B1="Y","S1,S2","S1"),IF(B1="Y","S2",""))
copy this function to C1 and drag the bottom right corner of that tab through the C column till there are entries in A and B!
=IF(AND(A1="y" , B1="y"),S1 & " " &S2,IF(AND(A1="y" , B1="n"),S1,IF(AND(A1="n" , B1="y"),S2 )
change the parameters as required...
hope this helped you!
Related
Hello I have the excel sheet below and would like to have a column that displays the name of maximum value as many times as the ID exists in the dataset for each ID
initial sheet
ID
Value
name
A
1
x
A
2
y
A
3
z
B
5
k
B
6
l
B
7
w
The desired output is:
ID
Value
name
name with max value per ID
A
1
x
z
A
2
y
z
A
3
z
z
B
5
k
w
B
6
l
w
B
7
w
w
If one has Office 365 with FILTER():
=#FILTER(C:C,(A:A=A2)*(B:B=MAXIFS(B:B,A:A,A2)))
For older excel version you can use INDEX/AGGREGATE array formula:
=INDEX(C:C,N(IF(1,MATCH(A2&AGGREGATE(14,6,(B:B*(A:A=A2)),1),A:A&B:B,0))))
Array formula after editing is confirmed by pressing ctrl + shift + enter
Assuming ID is column A, B, etc. In column D you'll want the following formula:
=INDEX( [table], MATCH(1, (MAXIFS([Value Column],[ID column],A2)=[Value Column]) *([ID Column] = A2),0),3)
Then hit CTRL + SHIFT + ENTER to turn it into an array formula and drag it down. Each instance I have [ ] I'm naming the data for the column from the header to the bottom for each. Substitute you cell or named references in their place. It's important that each of these are locked references and the same height (if column A goes down 8 rows, column b must as well)
Note: MAXIFS is only available in Excel 2019 and Office 365
Assuming you are using Office365 you can make everything array/ranges. I also assumed and your table starts in column A
=INDEX(C2:C7,MATCH(MAXIFS(B2:B7,A2:A7,A2:A7),B2:B7,0))
So I am trying to understand how to use excel to complete this exercise.
Basically, I have 4 columns (A, B, C, D). Looks like this:
A B C D E
CRT Carrot CRT CR
Apple Apple APL AP
Basically, I need to scan down column A and compare it to columns B & C. If the word in A matched either the full word in B or the three letter word in C, then I need to take the two-letter word in D and write it in column E.
I've managed to Use VLOOKUP to scan column A and column C and then append to E, however, I can't figure out how to have excel scan both B & C and then append D to E. (main issue here is that the input in A sometimes matches B and sometimes matched C).
Thanks!
I don't have a full grasp of your issue but have you tried aggregating the conditions in other columns like
Have column G Boolean check if A matches a word in B
Have column H Boolean check if A matches a three letter word in C
Have column I = G OR H
then have your result column based on I?
For what you are trying to achieve you can do with a nested if statement:
In Cell E1, use this fromula:
=IF(A1=B1,D1,IF(A1=C1,D1,""))
With the cell still selected, on the bottom right of the cell you will see a small square, click on this small square and drag down to auto-fill all the cells as required.
Formula: =IF(IFERROR(MATCH(A1,B1:C1,0),0)>0,D1,"")
Results:
If multiple values in column B are same, and corresponding values in column C are also same, then delete the rows containing those values otherwise, nothing. How do I do this in Excel (VBA)?
B C
XYZ Y
XYZ Y
ABC Y
XYZ N
So the result should be something like :
B C
XYZ Y
ABC Y
XYZ N
Thanks.
No need for VBA.
Just mark your data and go to the "Data" tab. Press "Remove duplicates" and make sure that both of the checkboxes called "Column B" and "Column C" are checked.
This removes rows if and only if the values in column B and C correspond to a duplicate row somewhere else in the marked data.
I want to check one entire column with value in another column and then assign a value in another column value to matching row cell.
Eg-
A B C D
1 10 X
2 3 Y
3 2 Z
4 11 K
What I want to do is take one value at a time from column A eg 1 and then scan through Column B if matches the Column A (value 1) then assign x to that row under D. eg if we check A3 ( value 2) with column B and found 2 is on B4 then D4 = Z. Like this I want to check all values in column in A against column B assign relevant vale from column C to Column D
How can I do this, can someone please help me.
Thanks.
Try:
= IFERROR(INDEX($C$2:$C$5,MATCH(A3,$B$2:$B$5,0)),"no match")
See below.
Try:
=IFERROR(VLOOKUP(A1,$B$1:$C$5,2,0),"")
Into column D, I'd like to copy the value from the last cell with data in columns E up until the column with the header "DETAIL". There might be anywhere from 2 to 15 columns from E until the column with that header, so that's where I'm stuck. So to be clear, an example:
A B C D E F G H DETAIL
1 x x x a b c d x
2 x x x x
3 x x x c b a x
3 x x x d c x
Should fill column D like so:
A B C D E F G H DETAIL
1 x x x d a b c d x
2 x x x x
3 x x x a c b a x
3 x x x c d c x
I don't mind handling this with a formula (which I couldn't come up with) or programmatically.
Create a dynamic named range by pressing CtrlF3 to bring up the Name Manager, click New, name the range something (I chose MyRange) and then use this formula to define it (Note you may need to change the Sheet name):
=Sheet1!E2:INDEX(Sheet1!2:2,MATCH("Detail",Sheet1!$1:$1,0)-1)
Then, in cell D2 and copied down, use this formula (I did not use IFERROR so that it would be backwards compatible):
=IF(COUNTA(MyRange),INDEX(MyRange,MATCH(REPT("z",255),MyRange)),"")
Here are the results (highlighted) using your provided sample data:
Please try:
=IFERROR(INDEX(F2:T2,,MATCH("zzzzzz",F2:T2)),"")
in D2 and copied down to suit.
Try using LOOKUP:
=IFERROR(LOOKUP(9^99,SEARCH("*",E1:H1),E1:H1),"")
SEARCH("*",E1:H1) returns a number when it matches any character and an error when the cell is blank. LOOKUP then returns the contents of the cells of the last number smaller than 9^99 in the array generated by SEARCH.
For example, in the first row, SEARCH("*",E1:H1) returns {1,1,1,1} so that LOOKUP returns the last 1, being d.
In the third row, SEARCH("*",E3:H3) returns {1, 1, 1, #VALUE!} and LOOKUP returns the last 1, which is a here.
This formula will work with numbers and text alike. The downside is that it is considered slower than INDEX/MATCH. On the other hand, you can modify the INDEX/MATCH to work with numbers, or modify it to work for both but becomes an array formula:
=IFERROR(INDEX(E1:H1,,MATCH(1,SEARCH("*",E1:H1))),"")
[Works with Ctrl+Shift+Enter, otherwise returns an empty cell with Enter alone]