LEFT Function

Zac

Well-known Member
Joined
Feb 20, 2002
Messages
796
Why doesn't the following pull the 01 from the date?

=LEFT(C8.2)

When C8 had 01/07/2004.

It works for 1234 and pulls 12.

Is there any way I can do it?
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
I think it is pulling the first two of the serial number for the date (37628), not the date itself.
 
Upvote 0
Is the date a date or text field. If it is a date field, try MONTH(C8).
 
Upvote 0
Because dates are stored as numeric values (the number of days since 1/1/1900).

Try:
=MONTH(C8)
 
Upvote 0
Because that is just a format; dates are numbers like 37994.6443376157 where the integer portion = days and the decimal portion hours/minutes/seconds. etc -- so, to get the month use--

=MONTH(C8)

format as desired.
 
Upvote 0
yes you can use that left function within an if statement.

it would look something like:

if (left(text(C1,"mm/dd/yyyy"),2)="01",DO SOMETHING,DO SOMETHING ELSE)

you actually dont even need the "/dd/yyyy" part if you dont want it.
 
Upvote 0
See your duplicate thread ('BuddyB').

Please don't create duplicates! Simply respond to this thread.

Edit: From the BuddyB thread:

NPO said:
=IF(ISNUMBER(C11),IF(MONTH(C11)=1,"yep","nope"),"nope")

IsNumber() is simply defensive.
I'll delete the 'BuddyB' thread at this point.
 
Upvote 0
Thanks everyone. I'll check things out this morning and see what happens.
This task should be a lot easier to resolve than it has been so far.
 
Upvote 0

Forum statistics

Threads
1,203,687
Messages
6,056,747
Members
444,888
Latest member
Babi_mn

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top