Hello All,
I've alter question in simpler way.
Right now I'm working on image where Col A & B has some values. I've to find values in Col C, where if Col A values "No Windows" & Col B values "No SQL".
I've used formula of IF AND statement in Col C. The Col C will represent it as "Yes" where Col A values "No Windows" & Col B values "No SQL" else formula will reflect it as "no".
For reference: In Col D represent the actual result needed after formula is applied.
Formula used : IF AND statement in Excel
=IF(AND(A2="No Windows",B2="No SQL"),"Yes","no")
So sometimes the data tested has leading or trailing spaces, try using trim() like this:
=IF(AND(trim(A2)="No Windows",trim(B2)="No SQL"),"Yes","no")
Related
I have two values in a sheet "SheetA"
SheetA:
Column A Column B
Apple 10.5
I want this two values to be matched with sheet "SheetB" and get the answer from Column C "Done"
SheetB:
Column A Column B Column C
Apple 10 Undone
Apple 10.5 Done
Using match function I tried
mav = Evaluate("INDEX(SheetB!$C$1:$C$5,MATCH(A1 & B1,SheetB!$A$1:$A$5&SheetB!$B$1:$B$5,0))")
Msgbox mav
I receive:
Error 2042
Please help me on this. This is an example. I wanted to use this formula in my code once I get a solution. Thanks in advance.
When I refer the values with same sheet like below it is working.
mav = Evaluate("INDEX($C$1:$C$5,MATCH(A1 & B1,$A$1:$A$5&$B$1:$B$5,0))")
When I refer it to different sheet, it is not working.
mav = Evaluate("INDEX(SheetB!$C$1:$C$5,MATCH(A1 & B1,SheetB!$A$1:$A$5&SheetB!$B$1:$B$5,0))")
You missed the = character:
mav = Evaluate("=INDEX(SheetB!$C$1:$C$5,MATCH(A1 & B1,SheetB!$A$1:$A$5&SheetB!$B$1:$B$5,0))")
Other than that error 2042 equals #N/A so maybe you have made a bad sheet reference. With correct references the code works fine, see below:
What's also nice to note; this actually is an array formula, but in VBA you only need the string value of the formula :)
Columns H-AB contain individual dates,
Column A contains text,
Column F contains dates.
I want to conditionally format column H if $A8 says "Project Completion" and H$7 is equal to the date in $F8.
I've really struggled with formatting dependent on multiple variables so I could use some help. When I select the area I want to apply the rule to and test, it formats a single cell in the correct column two rows above my input. Can't figure out why.
EDIT
Thank y'all for the responses, but it seems like maybe my wording wasn't great. What I have so far vs what I want to do. My formula is =and($a8="Project Completion", $f8=h$7)
Thanks again for all the help.
I assume that data is moving down rows. And the format should apply on a row by row basis.
Select Column H (or relevant rows in Column H) and enter this formula:
=AND(A8="Project Completion",$F8=H7)
I am not sure if it is a typo on your question having fixed H$7.
If validation is by row:
=(INDIRECT("A" & ROW()) = "Project Completion")*(INDIRECT("F" & ROW())=INDIRECT("H" & ROW()))
If validation is by row and value on column F is equal to H7:
=(INDIRECT("A" & ROW()) = "Project Completion")*(INDIRECT("F" & ROW())=H$7)
If validation is only for row 8 and F8 is equal to H7:
=($A$8 = "Project Completion")*($F$8 = H$7)
I have two columns in Excel:
Column A
Row 1 Apple
Row 2 Blueberry
Row 3 Strawberry
Column B
Row 1 App
Row 2 Application
Row 3 Appendage
I would like to use Column B to see if any cells within it exist within the given cell in Column A. So far, I have used the VLOOKUP and MATCH functions and I can't seem to get either to work properly, but MATCH seems to be the one I should be using. I tried using wildcards on Column B and it returns a value error. Here is what I have:
=MATCH(A1,"*"&B:B&"*",0)
Your help is greatly appreciated!
There is a natural VBA solution. In a standard code module place:
Function PartialMatch(v As Variant, R As Range) As Variant
Dim i As Long
For i = 1 To R.Cells.Count
If v Like "*" & R.Cells(i).Value & "*" Then
PartialMatch = i
Exit Function
End If
Next i
PartialMatch = CVErr(xlErrNA)
End Function
Then where you want it in a spreadsheet you can use the formula:
=PartialMatch(A1,B:B)
It will give the index of the first partial match, if any exists, or #N/A if it doesn't. Note that a blank cell counts as a partial match, so you might want to make sure that the range that you pass the function contains no blanks (so don't pass the whole column). That, or redefine what you mean by a partial match.
Can you please help regarding this formula in Excel 2007:
INDEX('MappFile'!F:F &"","" & 'MappFile'!G:G, MATCH(E:E,IF('MappFile'!E:E="Prod",('MappFile'!C:C)),FALSE))
The intention/purpose is the following:
'To match column E from main file
'With column C from 'Mapping File'
'Based on this take F & G from 'MappFile'
'filtering only the rows where column E from 'MappFile' = Prod
Thank you in advance!
For Vasim: this is a variant that works (syntaically) but doesn't grant the desired result:
=INDEX('MappFile'!F:F, MATCH(E:E,IF('MappFile'!E:E="Prod",('MappFile'!C:C)),FALSE))
In my example, the IF is intended to do the filtering but it must probably be done differently
EDIT: You should make an extra column that filters with your if, and then use that column as the comparison array.
Simply - if any cell in Column B contains thisvalue then append to the adjoining cell in Column A with sometext.
How is this done?
A simple if statement. For example:
=IF(ISNUMBER(SEARCH(thisvalue, B1)), sometext, "")
EDIT: The ISNUMBER(SEARCH(thisvalue, B1)) searches for thisvalue in B1, and if it finds it, it returns a number (that number being the starting index of thisvalue within B1).
EDIT #2: To append the inserted value to the end of the current value in cell A, use the CONCATENATE formula.
Example:
=CONCATENATE(A1, sometext)
Put this formula in A1, then drag down as necessary:
=IF(B1="thisvalue","sometext","")
EDIT
Using a the Visual Basic Editor, you can update the contents of cell A like this:
Private Sub UpdateColumnA()
Dim x As Long
For x = 1 To 65536
If InStr(1, Sheet1.Range("$B$" & x), "thisvalue") > 0 Then
Sheet1.Range("$A$" & x) = Sheet1.Range("$A$" & x) & "sometext"
End If
Next
End Sub
Repeated runnings of the macro, however, will append the text again; you'll need more validation code if you don't want this to happen.
copy-paste in A1 , considering that you have values in B
=IF(ISNA(VLOOKUP("thisvalue",B:B,1,FALSE)),"",VLOOKUP("thisvalue",B:B,1,FALSE)&"ADDITIONAL VALUE")
it is saying:
if value of vlookup is is empty (if lookup returns nothing) , then show empty value ( double quotes)
but if the value of lookup returns something, then do this lookup and append "ADDITIONAL VALUE" text to found result
I think I have what you are looking for, let me know if you are still interested and if you want me to elaborate further. This formula in cell F2: =IF(ISNUMBER(SEARCH($U$2,E:E)),$V$2,"")&IF(ISNUMBER(SEARCH($U$3,E:E)),$V$3,"")&...
where you are searching for a value that you specify in U2 across all cells in column E:E, if it finds a match it appends the value you specify in V2. To search for multiple words assigning corresponding value simply concatenate as shown as much as you like. I am able to specify hundreds of words (and corresponding values). I hope it helps.