+ Reply to Thread
Results 1 to 7 of 7

Two separate problems: Getting month for date from formula field, and cond.form. columns.

  1. #1
    Registered User
    Join Date
    04-08-2014
    Location
    California
    MS-Off Ver
    2013
    Posts
    3

    Two separate problems: Getting month for date from formula field, and cond.form. columns.

    Sorry, hard to make this a really descriptive title.

    I am having trouble figuring out two separate things that aren't really related, but I figured they could be consolidated to one thread since they should be fairly simple:

    The first is pulling the month for a date field from another field that is getting the month from the title of the worksheet.

    So the formula in A1 is:
    Please Login or Register  to view this content.
    The title of the worksheet is "January" (although each worksheet will have a different month name), so A1 is filled with "January".

    I want A4 to be formatted with 1-Jan, pulling the month from A1, so that changing the title of the worksheet changes the month in A1, and A4.

    I tried
    Please Login or Register  to view this content.
    hoping that it would format it as a date after filling it as text, but it stays as "1-January". A5 which is
    Please Login or Register  to view this content.
    still recognizes A4 as a date and formats as "2-Jan".

    I tried putting "mmm" somewhere in there to get January to format to Jan, but that didn't seem to work. I tried
    Please Login or Register  to view this content.
    but it seems to not recognize "January" from A1 as a month.

    Here's the worksheet for this: Book2.xlsx



    Issue number 2 is how to format entire columns if a row in that column meets certain conditions.

    I have this one to format rows when the day in column B is "Sun":

    Please Login or Register  to view this content.
    But I can't figure out how to get something similar to apply to an entire column when the string in row 3 is equal to something. I also don't exactly understand why the above code works, I just found it with google. Why does it need the 1?

    I also have one small question about the same code above. It seems to have left some residual borders from before the days shifted by changing the month. You can see this in the attachment. Why? And how do I fix it without manually changing the borders for all those rows?

  2. #2
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Two separate problems: Getting month for date from formula field, and cond.form. colum

    Woogity,

    Welcome to the forum.

    Try this in A4 for the first issue:

    Please Login or Register  to view this content.
    Brendan.


    __________________________________________________________________________________________________
    Things to consider:

    1) You can thank any poster by clicking the * at the left of a helpful post.
    2) You can help to keep the forum tidy by marking your thread as "Solved", if it has been answered to your satisfaction.
    3) Help us to help you, by uploading a sample workbook, showing the type of data you're dealing with, and clearly indicating what the results should be.

  3. #3
    Registered User
    Join Date
    04-08-2014
    Location
    California
    MS-Off Ver
    2013
    Posts
    3

    Re: Two separate problems: Getting month for date from formula field, and cond.form. colum

    Thanks, that worked well, and I'm sure knowing that the "LEFT" function exists will be helpful later.

  4. #4
    Registered User
    Join Date
    09-24-2013
    Location
    Twin Cities, MN
    MS-Off Ver
    Excel 2010
    Posts
    91

    Re: Two separate problems: Getting month for date from formula field, and cond.form. colum

    A shorter form of Brendan's answer:

    ="1-"&LEFT(A1,3)

  5. #5
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Two separate problems: Getting month for date from formula field, and cond.form. colum

    So.... here's your file back, with some Conditional Formatting in C4:C34 and D4:D34.

    For Column C - the formula:

    Please Login or Register  to view this content.
    says "IF" (the IF is inferred) "the contents of C1 equal February", apply the chosen formatting.

    Column D - the formula:

    Please Login or Register  to view this content.
    says "if the length of the value/string in D1 equals 3", apply the chosen formatting. Change "March" to "Mar" and see what happens.

    Also, google Absolute and Relative cell referencing re the $ that you seem unsure about.

    Hope this helps.
    Attached Files Attached Files
    Last edited by BB1972; 04-08-2014 at 02:23 PM. Reason: Correcting spelling

  6. #6
    Registered User
    Join Date
    04-08-2014
    Location
    California
    MS-Off Ver
    2013
    Posts
    3

    Re: Two separate problems: Getting month for date from formula field, and cond.form. colum

    Quote Originally Posted by BB1972 View Post

    For Column C - the formula:

    Please Login or Register  to view this content.
    says "IF" (the IF is inferred) "the contents of C1 equal February", apply the chosen formatting.

    Also, google Absolute and Relative cell referencing re the $ that you seem unsure about.
    Thanks. Totally get it now. I was thinking the $ applied to both the column and row in $C1 (rather than needing $C$1).
    Last edited by Woogity; 04-08-2014 at 03:00 PM.

  7. #7
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Two separate problems: Getting month for date from formula field, and cond.form. colum

    Good stuff - glad we could help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Formula/cond format to calculate 12 month expiries
    By bananas123 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-26-2014, 06:37 AM
  2. VLookup formula to separate days from a date field
    By damagedbodies in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-13-2010, 12:48 PM
  3. If function to separate the days from a date field
    By damagedbodies in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 03-09-2010, 02:11 PM
  4. Converting a date field into a month-year only field
    By C.Hirsch in forum Excel General
    Replies: 1
    Last Post: 04-24-2006, 07:15 PM
  5. Auto complete form field from separate list
    By famdamly in forum Excel General
    Replies: 0
    Last Post: 12-05-2005, 09:42 PM

Bookmarks

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