Results 1 to 3 of 3

Code for summing values until condition met in each cell in a range

Threaded View

  1. #1
    Registered User
    Join Date
    10-28-2015
    Location
    Estonia
    MS-Off Ver
    2013
    Posts
    2

    Code for summing values until condition met in each cell in a range

    Hi! I am a beginner in VBA and unfortunately I cannot come up with a solution for my problem. Hopefully someone can help me at least with some suggestions how to do it.
    Hõiva.PNG

    I would like to create a macro, which should be calculating the inventory in EUR at the end of each period (in this example for each cell in range B5:N5). The inventory amount comes from cost of goods sold (row 3) based on given number of days (row 4). The number of days is a input from the user and can be any positive number. In my example in B5 the amount comes from cost of goods sold in January, February and partially in March, because number of days in B4 is reached in March (31 days in January, 29 days in February and 90-31-29=30 days in March). The calculation is then following 250(C3)+300(D3)+450(E3)/31(E2)*(90(B4)-31(C2)-29(D2)).

    I have attached also the Excel file, where you can see which values should be calculated based on the VBA code.

    Thank you!
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Using countifs with date range, and summing values in that range
    By bmcoonan in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-30-2013, 11:28 AM
  2. [SOLVED] Makro with if condition to check for numeric and text values in a cell range
    By Postlki1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-14-2013, 07:53 AM
  3. Summing values for a particular date range and putting into one cell.
    By Catherine01 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-11-2013, 01:49 AM
  4. Summing values within a range of dates
    By Blackavar in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2010, 09:18 PM
  5. Adding cell values in range based on condition
    By alexandruc in forum Excel - New Users/Basics
    Replies: 11
    Last Post: 10-05-2009, 02:42 AM
  6. Summing of Matching Values for condition
    By bdb1974 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-10-2009, 05:48 PM
  7. Replies: 10
    Last Post: 03-05-2009, 04:33 PM
  8. [SOLVED] Summing values within a range
    By rmellison in forum Excel General
    Replies: 7
    Last Post: 09-02-2005, 08:05 AM

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