+ Reply to Thread
Results 1 to 8 of 8

counting occurences by month

  1. #1
    Registered User
    Join Date
    09-22-2006
    Posts
    13

    counting occurences by month

    Hi there,
    how do I go by...

    if A1 is blank then ignore if A1 is not blank then look up date in B1 and count by month in C1.

  2. #2
    Registered User
    Join Date
    09-22-2006
    Posts
    10
    Use the IF function with the COUNTBLANK function:

    IF(logical_test,value_if_true,value_if_false)
    COUNTBLANK(range)


    Try the following line:

    =IF(COUNTBLANK(A1) = 1, "Blank", "Not blank")

    When implimenting "new" things for the first time I make the output a simple text, not perform another function. This tells me if I did it correctly or not, that way I am troubleshooting my problems 1 at a time, not 3 or 4.

    Once you get that to work, replace the "Blank" (value_if_true) and "Not blank" (value_if_false) with the output or formulias you need.

  3. #3
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Thumbs up

    Quote Originally Posted by thalpo
    Hi there,
    how do I go by...

    if A1 is blank then ignore if A1 is not blank then look up date in B1 and count by month in C1.
    Hello thalpo,

    When you say and count by month in C1, I'm assuming you want the number of the month from B1. If this is the case then put this into C1

    =IF(A1="","",MONTH(B1))

    oldchippy

  4. #4
    Registered User
    Join Date
    09-22-2006
    Posts
    13

    still trying to count

    Hi again,

    I think I did not explain it right. What I am trying to do is:

    I put a book title in A1 and a start date when I started reading it in B1. Lets say I started 50 different books. Now need to find out how many books I started in which month. I need it to ignore A1 if I have not put a title in. I hope this makes more sence. thanks a million in advance.

  5. #5
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Thumbs up

    Ok, try this

    A1 type Title
    B1 type Date
    C1 type Month
    A2 "Your Book Title"
    B2 22/09/06
    C2 = IF(A2="","",MONTH(B2))
    Fill all the rows below as required, for now assuming 50 books.
    Drag formula in C2 down 500 rows for now (assuming your not always reading - are you?)

    Now go to Data > Pivot Table Report
    Step 1 (accept defaults) and click next
    Step 2 enter $A$1:$C$500
    Step 4 click Layout...
    Drag "Title" to Row and drop
    Drag "Date" to Page and drop
    Drag "Month" to Column and drop
    Then "Month" again to Data
    Double click on "Sum of Month", in Summarize box select "Count Nums"
    OK, Finish

    You should now have a Pivot Table on a new sheet with bars floating on your sheet. When you add more books to your list, to refresh you Pitot Table click the Refresh icon.

    Let me know how you get on

    oldchippy

  6. #6
    Registered User
    Join Date
    09-22-2006
    Posts
    13

    works

    Hi there,

    this works perfect. I did it w/o the pivot table....
    but it always returns 1 if I only put the title in and leave the date empty. I might have the book and already input it but have not started reading yet. What you say?

  7. #7
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Thumbs up

    Quote Originally Posted by thalpo
    Hi there,

    this works perfect. I did it w/o the pivot table....
    but it always returns 1 if I only put the title in and leave the date empty. I might have the book and already input it but have not started reading yet. What you say?
    Hi,

    Modified to display nothing if only one cell is filled in

    =IF(OR(A1="",B1=""),"",MONTH(B1))

    Have a good read

    oldchippy

  8. #8
    Registered User
    Join Date
    09-22-2006
    Posts
    13

    Smile count occurences by month

    Hello oldchippy,

    thanks a million. That is exactly what I needed.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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