Consulting

Results 1 to 2 of 2

Thread: Solved: SELECT CERTAIN COLUMN BASED ON IF DATE BETWEEN

  1. #1
    VBAX Contributor
    Joined
    Dec 2006
    Posts
    193
    Location

    Solved: SELECT CERTAIN COLUMN BASED ON IF DATE BETWEEN

    I have a spread sheet with 12 columns starting at column C representing the 12 months of the year(JAN -DEC) In column "A" a user enters a date and in column "B " a unit amount.I would like the unit amount to be refelected in the appropriate column ie: if the date is 3rd March the amount would show in column E

    THANKS

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    if C2 is the top left cell of the data part of your data then paste this formula there:
    =IF(AND(MONTH($A2)=COLUMN()-2,$B2<>""),$B2,"")
    copy across the 12 months horizontally, then down as far as you need.
    This only checks the month, not the year.

    p45cal

    ps if the top left cell is say, C6, then the starting formula would be:
    =IF(AND(MONTH($A6)=COLUMN()-2,$B6<>""),$B6,"")
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

Posting Permissions

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