# IF statement is not working while comparing Text

#### Sun11

##### New Member
Hi, here is the problem. In following table at the place of "Angle" I fetch data using following formula.
Code:
``=IF(A2 = "<<<","Ingress",LEFT(A2, SEARCH(" ",A2,1)))``
 Description Angle Aspect Dg <<< Ingress Trine Venus Trine

<tbody>
</tbody>

Now at "Aspect Dg" I tried using following formula with IF statement but its not working.
Code:
``=IF(B2 ="Ingress","None",IF(B2 ="Trine", 120,IF(B2 ="Conjunction",0,IF(B2 ="Opposition",180,IF(B2 ="Square", 90, 60)))))``
It always showing me 60, if "Angle" is not "Ingress"

Regards

Last edited:

#### gaz_chops

##### Well-known Member
I just copied and pasted your sample & formula, I get 120?

#### gaz_chops

##### Well-known Member
It is your 1st formula which is incorrect, it is returning a space at the end "Trine "

Try
=IF(A2 = "<<<","Ingress",LEFT(A2, SEARCH(" ",A2,1)-1))

• Sun11

#### Sun11

##### New Member
It is your 1st formula which is incorrect, it is returning a space at the end "Trine "

Try
=IF(A2 = "<<<","Ingress",LEFT(A2, SEARCH(" ",A2,1)-1))
Thank you so much i corrected my first formula & it worked!! )

You're welcome.

1,081,526
Messages
5,359,287
Members
400,524
Latest member
Excelbat

### This Week's Hot Topics

• VBA (Userform)
Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
• List box that changes fill color
Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
• Remove duplicates and retain one. Cross-linked cases
Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
• VBA Copy and Paste With Duplicates
Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
• Macro
is it possible for a macro to run if the active cell value is different to the value above it
• IF DATE and TIME
I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...