# looking to combine if and mid function---i think

1. ## looking to combine if and mid function---i think

Three cells lets say A1, B1, and C1.

A1=2012
B1=JAN-1-2012
C1=JAN

Currently i have it set up to fill in C1 automatically with JAN by using =MID(B1,1,3)
What i am hoping to acheive is only fill in C1 with JAN if year reads 2012 by getting from A1, if A1 reads 2013 and B1 reads JAN-1-2012 then C1 is blank. What is formula to achieve this??

2. ## Re: looking to combine if and mid function---i think

Are these formatted as dates, or just strings that you're using as an example?

3. ## Re: looking to combine if and mid function---i think

Try this in C1:
=IF(A1=2012,"JAN","")

4. ## Re: looking to combine if and mid function---i think

=IF(A1=2012,left(B1,3),"")

5. ## Re: looking to combine if and mid function---i think

Perhaps i didnt explain enough A1 will read 2012, B1 will read any date that is entered manually. C1 will only count first three, so JAN, FEB, MAR, ETC. Now if i change A1 to 2013 all C1's will be blank.

6. ## Re: looking to combine if and mid function---i think

Hi awest, can you answer Miraun's question... thanks...

7. ## Re: looking to combine if and mid function---i think

Yes formated as a date

8. ## Re: looking to combine if and mid function---i think

Try this...

=IF(A1=2012,CHOOSE(MONTH(B1),"JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"),"")

9. ## Re: looking to combine if and mid function---i think

if you are extracting jan by
"Currently i have it set up to fill in C1 automatically with JAN by using =MID(B1,1,3)"
then that cell is not a real date but text
otherwise it would return 409 the first 3 digits of 1/1/2012 date code
so it must be text then
=IF(--RIGHT(b1,4)=--a1,LEFT(b1,3),"")

10. ## Re: looking to combine if and mid function---i think

still not working, please help. I have included attachment. This spreadshee is used as a counter on another spreadsheet. It counts the JAN, FEB, ETC from the L cloumn. But when year changes we have to go in an manually look for the 2012 entries and make column blank so it is not counted. What i would like to do is just change the year in cell A2 to 2013 and have all entries in column L go blank--so they are not counted on corosponding spreadsheet.

11. ## Re: looking to combine if and mid function---i think

in l2
=IF(M2="","",IF(--RIGHT(M2,4)=--\$A\$2,LEFT(M2,3),""))

12. ## Re: looking to combine if and mid function---i think

success---thanks martin

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1