+ Reply to Thread
Results 1 to 4 of 4

I'm stumped - using if function with date

  1. #1
    Forum Contributor
    Join Date
    05-22-2007
    Location
    Laguna Beach, CA
    Posts
    142

    I'm stumped - using if function with date

    Using Office 2019.

    I'm stumped and I just can't figure out how to use the "if" function along with a date (only the month).

    In cell A1, I have the date (let's say December 31, 2022).

    In cell B1, I want to return $100 if the contents of A1 is either March, June, September, December, if not, show "".

    The part I can't figure out is how to use the "if" function with no regard for the "day and year", just use the month.

    Any help would be appreciated.

    Bruce

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.85 (24051214))
    Posts
    8,830

    Re: I'm stumped - using if function with date

    MONTH(A1) will return the month number
    so
    if A1 is march - you will get a 3

    =IF(OR(MONTH(A1)=3,MONTH(A1)=6,MONTH(A1)=9,MONTH(A1)=12),100,"")

    maybe able to use another way to show the qtr months
    But thats an IF


    Often, A sample sheet would help

    The forum does allow for spreadsheets to be uploaded direct to the forum -

    Please see the Yellow Banner at the top of the page explaining how to attach a sample spreadsheet

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, relevant cells highlighted and a few explanatory notes.

    Here are the instructions, found at the top of the page again
    Post a small Excel sheet (not a picture) showing realistic & representative sample data WITHOUT confidential information (10-20 rows, not thousands...) and some manually calculated results. For a new thread (1st post), scroll to Manage Attachments, otherwise scroll down to GO ADVANCED, click, and then scroll down to MANAGE ATTACHMENTS and click again. Now follow the instructions at the top of that screen.
    Attached Files Attached Files
    Last edited by etaf; 11-20-2022 at 07:34 PM.
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Contributor
    Join Date
    05-22-2007
    Location
    Laguna Beach, CA
    Posts
    142

    Re: I'm stumped - using if function with date

    This forum is the best....

    The formula supplied by "etaf" worked perfectly.....=IF(OR(MONTH(A1)=3,MONTH(A1)=6,MONTH(A1)=9,MONTH(A1)=12),100,"")

    Many thanks.

    Bruce

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.85 (24051214))
    Posts
    8,830

    Re: I'm stumped - using if function with date

    you are welcome

+ 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. Date Format Stumped
    By RJL3313 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-07-2015, 12:12 PM
  2. Stumped with Date function
    By TeeJay from Oz in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-07-2009, 07:52 AM
  3. Stumped on tabbing function
    By Theboomanchu in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-22-2008, 02:31 PM
  4. Stumped by a TEXT function
    By papastyle3 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-26-2008, 10:12 AM
  5. Stumped on this IF function...
    By pvp151 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-30-2007, 06:24 AM
  6. [SOLVED] Stumped with an IF function
    By Grant Reid in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-13-2006, 10:10 AM
  7. [SOLVED] Stumped on Lookup Function
    By FishHead in forum Excel General
    Replies: 7
    Last Post: 05-10-2006, 03:25 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