• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

syntax for IF formula

maradykstra

New Member
How would I write the IF formula if I am trying to determine if the first number starts with a certain number? I want to say all the numbers that start with a 0 get assigned the "Red" and if another number doesn't start with a 0 then it would "Blue"


Example:


00234

00485

00848

93040

50393


If(_____,"Red", "Blue")


I'm just having a hard time creating the syntax for the logical text.


Thanks.
 
Yung

To have numbers appear as 00234 the numbers are either text or use formatting and hence the answer is different


If the numbers are Numbers

=If(A1<10000,"Red","Blue")


If the numbers are text

=If(left(A1,2)="'0","Red","Blue")
 
Hi,


If the "numbers" were text or formatted numbers you could use this formula for both


=IF(VALUE(A1)<1000,"Red","Blue")
 
Back
Top