I have two columns A , B
A:have text
B:have values
I need to add the first value of B in first cell of Column C then, the next cell of column C have the first text of A and so on
EX:
C1:1234
C2:what is your name
OK... you aren't exactly clear on your question, since you can't have 2 cells in column C. But I think what you want to do is write this formula in cell C2:
=B2 & " " & A2
That will put values from both columns A and B in the same cell, separated by a space. But it's unclear what you want since "the first text of A and son on" could be interpreted many ways.
Please try the above formula and if it does not meet your demands then think of how you can rephrase your question.
----Edit----
In C1 enter the value:
=B1
In C2 enter the value:
=A1
Highlight both C1 and C2, then drag down with the fill handle. That should do it.
Related
In Excel I have a problem...I don't know many formulas/rules.
This is my case:
Scenario 1)
A B C
1.| Drw....3350......03
2.| Drw....3350......02
This is my desire:
I want to hide row 2.
Scenario 2)
A B C
1.| Drw....3350........03
2.| Img.....3350........02
This is my desire:
I want to keep both rows.
My problem in words:
Scenario 1: Because A1 & A2 + B1 & B2 are the same, I want to hide the row with the smallest number in column C.
Scenario 2: Because A1 & A2 are different I want to keep both rows, even though B1 & B2 are the same.
This is a simplified example. Column A could consist of hundreds of rows with mixed values. However, Column A is text and column B and C are values.
There will not be such a case when C1 & C2 are the same. (only if someone typed in wrong)
What I am asking:
I don't know what formulas or rules to use in Excel and would prefer to not use VBA for this. Seems like such a simple task but I just don't know how to.
Anyone?
In your Title you mention and B1>B2 and then give two examples in both of which the 'B' values are the same, so assuming you mean to hide the lower C value where the A values match and the B values match then in a helper column, say E:
=A2&B2
and in another column (I chose H):
=AND(MIN(IF(E7=E:E,C:C))=C7,MAX(IF(E7=E:E,C:C))<>C7)
entered with Ctrl+Shift+Enter and copied down to suit. Then filter that column to select for FALSE:
Basically... I have 800+ names in columns B and C. I have another 700,000+ names in column A. So I want to check A1 to see if part of the text is found anywhere in B and C and then output the answer to D1.
For example... A1 has the name mike trout in it. Somewhere in b or c could be the name trout. I want D1 to output TRUE because a cell in b or c contained part of the text found in A1. If the names Mike or Trout are nowhere to be found in columns b or c, I want D1 to say FALSE. Can this be done? I've been searching online for hours and cannot come up with the correct formula that works. Thanks.
This is a slightly more complex version of this answer: https://stackoverflow.com/a/22754109/293078. Both use COUNTIF with wildcards. This one requires a helper column. Here's how it looks:
Column B has a formula that adds a space before and after the corresponding name in column A. The formula in B2 is:
=" " & A2 & " "
This gives means that we'll only get matches for full words, e.g., "Ted" won't match "Teddy Bear," but "Teddy" will.
As you described, columns C and D contain the names to search for. Finally, in E2, we have this array formula, which must be entered with ctrl-shift-enter:
=SUM(COUNTIF(B2,"* " & $C$2:$D$8 &" *"))>0
Drag the formulas in B2 and E2 down 700,000 rows and watch the magic happen.
I thought this would be hopelessly slow, but I just tried 700,000 rows and it finished in a few seconds.
I want to accomplish a certain task in excel.
I want to practice 10 key skills.
I have typed numbers in column A(cells, A1,A2,A3,etc.). I want to retype them in column B. Then (if column B matches column A) would like to have the word "OK" appear in column c. Can write the simple IF statement for A1=B1. Do not know how to make the statement automatically apply to other cells(i.e if A2=B2, A3 =B3, etc).
Thanks. CD
In cell 'C1'
=If(A1=B1,"OK", "")
Now drag this cell down col C until your last row. Excel will auto increment A1 & B1 to A2 & B2 and so on... unless you use absolute referencing which is the dollar sign like this $A$1 for example.
I have two columns. Each cell in column A contains a full sentences and each cell in column B contains a word or phrase. I would like to check if the contents of each cell in column B appears in one of the cells in column A---it could appear in multiple cells in column A or in no cells. The output just needs to be a yes or no (and should be spit out in column C) for my purposes, but it would be neat to return the number of times each column B word came up somewhere in Column A.
So far I haven't figured out how to take a discrete string of letters (already printed in one cell) and search across a range in a column. Not sure if this is beyond the regular excel functionality.
Thanks very much for your help!
Use array formula like this:
=SUM(IF(ISERROR(SEARCH(B1,A:A,1)),0,1))
enter in formula bar then press CTRL+SHIFT+ENTER.
Hope this helps.
Put formula in C.
Try This :
=countif(a:a,"*" & b2 & "*")>0 gives you result in True/Flase
To get the occurrence
=countif(a:a,"*" & b2 & "*")
To get YES/NO
=if(countif(a:a,"*" & b2 & "*")>0,"YES","NO")
I have an Excel table with 4 columns and need to find the values that are the same in ALL 4 of the columns and put them aside. Trying to figure out how to accomplish this in Excel.
Example:
Column 1 Column 2 Column 3 Column 4
A1 B1 B1 A1
B1 C2 C1 B1
C2 D3 C2 C2
In this example, both B1 and C2 values comply and must be set aside.
Put this formula in cell D1 and drag and drop it till the end of your values:
=IF(AND(COUNTIF($B$1:$B$3,A1)>0,COUNTIF($C$1:$C$3,A1)>0,COUNTIF($D$1:$D$3,A1)>0),A1,"not found")
For the record, the french version:
=SI(ET(NB.SI($B$1:$B$3;A1)>0;NB.SI($C$1:$C$3;A1)>0;NB.SI($D$1:$D$3;A1)>0);A1;"not found")
To generate a list of values that appear in all four columns, try in cell F2:
=INDEX(A$1:A$3,MATCH(TRUE,COUNTIF(B$1:B$3,A$1:A$3)*COUNTIF(C$1:C$3,A$1:A$3)
*COUNTIF(D$1:D$3,A$1:A$3)*NOT(COUNTIF($F$1:F1,A$1:A$3))>0,0))
confirmed with CTRL+SHIFT+ENTER and fill down as far as needed (this assumes F1 is blank or contains unrelated data)
I couldn't get the above examples to work for myself, so I came up with another solution. Hopefully this will help someone else out there:
=IF(ISNUMBER(MATCH($A2, $B$2:$B$4, 0)), IF(ISNUMBER(MATCH($A2, $C$2:$C$4, 0)), IF(ISNUMBER(MATCH($A2, $D$2:$D$4, 0)), $A2, ""), ""), "")
This checks the value in "Column 1" ("A" column in excel) against the next 3 columns (B,C,D). If the value is present in all three it returns the A column value. If it is not present in all 3, it returns empty. If you would rather return something else, put that something in between the empty quotation marks.
For your data, enter in the lengths of the searched columns, B through D. For example, where it says, "$B$4", put in "$B$99" if the cells go down to 99, but it should work if you put in a generically high number, for example, 99999.
Put this in the row of the first value, so here that would be E2, and then copy it down to every row that has a value in column A.
The function works by just nesting IF statements, and can be expanded or contracted depending on how many columns you want to check against. The function can also be easily modified into a "check if in column B OR column C" function pretty easily.
here is an example for 1 value; I can't generalize since I did not see your data source
Sub test()
If (Range("D6").Value = Range("D6").Offset(0, 1).Value) Then
MsgBox "match"
End If
End Sub
you can also delete duplicates across multiple Columns by using DATA-> Remove Duplicates.