+ Reply to Thread
Results 1 to 2 of 2

Formatting and formulas for dates, fills & numbers

  1. #1
    Registered User
    Join Date
    03-19-2013
    Location
    San Antonio, Texas
    MS-Off Ver
    Excel 2010
    Posts
    15

    Formatting and formulas for dates, fills & numbers

    This question is on formatting/formulas and macros.

    I run a daily report on all 7 of our locations, each location has its own separate report. This means the number of data lines can vary widely, so any formula must be flexible enough to catch the data whether it is 5 lines or 150 lines (line # 1 is the header line). I am trying to reduce the number of formatting steps I need to do, before transferring the data into my final reports, by creating macros for multi-step formatting. Can anyone help me with any of the “bumps in the road” I am coming across?

    The report format I have is 8 columns:
    A = blank
    B = customer location (i.e. Q.56829-A)
    C = account #
    D= customer name
    E = order status
    F = service date (date of sale)
    G = service time (time of sale)
    H = hours:mins (since order placed) which comes across in this format: 1/2/1900 7:45:00 AM, but I have it pre-formatted to display as 55:45 (hours:mins)
    I = payment method

    Bump # 1:
    I inserted the blank column A and I want it to display today’s date. [U]If columns B thru I, on the same line, are blank, I want the cell in column A to be blank, too, only fill in column A if there is data on that line).
    The steps I did, in order:
    in cell A2: =IF(B2<>””,TODAY(),””)
    Format column A for date
    Copy A2
    Highlight Column A
    Paste

    But, I need to stop the paste at the first blank line. As a reminder, this is a daily report on 7 different locations, the number of lines will vary on each report, so setting it for a specific number of lines will not work. As a thought, do I need to change the sequence of events? For example, format the column for date before using the formula?

    Bump # 2:
    I sort the data by payment method and hours:mins (largest to smallest). I cut the lines for a specific payment type (purchase order) and place those lines further down the sheet (it needs to be worked with separately). I then need to go back to the non-purchase order lines and re-sort by hours:mins, so the longest times are listed on top (the “purchase order” lines are already sorted by time, from the first sort). I have the initial sorting in a macro, but when I try to program the second sort (separate macro), it re-sorts all of the data, not just the entries I have highlighted (I highlight first, before running the second macro). Is there a way I can program the second sort, in a macro, so it will sort only the lines I have highlighted?

    Bump # 3:
    In column H, I need to format in the number of days since the order was placed, not by hours:mins, if the payment method (column I) says “purchase order”. I am manually entering =DATEDIF(F2,A2,”D”) and format the cells for number, no decimals. Then I copy that down the lines. Logically, I should use =DATEDIF(IF(I:I,”purchase order”)(F2,A2,”D”)) but, it (or variations) do not work. Is there a formula that will automatically format column H if column I says “purchase order”, but will leave the hours:mins if not?

    If all of these steps cannot be done in one macro, I can create as many as needed.

    I apologize for this post being so long, I am just trying to be clear on the steps I need to do. Thank you for your help!

  2. #2
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Formatting and formulas for dates, fills & numbers

    Any possibility of a small sample sheet, just to test possible solutions on ?

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

+ 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. Need a table, which fills in numbers automatically depending on text in column
    By Hotsoup666 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-20-2013, 03:13 AM
  2. Replies: 9
    Last Post: 03-26-2012, 02:16 PM
  3. Conditional Formatting Formulas for Multiple Dates
    By smart_as in forum Excel General
    Replies: 4
    Last Post: 03-02-2011, 06:03 PM
  4. How to Create a Time Sheet that Fills Out Dates Automatically
    By qualityoflife in forum Excel General
    Replies: 2
    Last Post: 12-10-2010, 06:57 AM
  5. Conditional formatting formulas for dates
    By oakman in forum Excel General
    Replies: 6
    Last Post: 10-31-2007, 03:13 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