+ Reply to Thread
Results 1 to 2 of 2

How to add a fixed value to ANY cell in a chart based on a fixed condition

  1. #1
    Registered User
    Join Date
    02-01-2023
    Location
    New York, New York
    MS-Off Ver
    Office Professional Plus 2016
    Posts
    1

    Question How to add a fixed value to ANY cell in a chart based on a fixed condition

    Hello

    i am trying to make a chart to calculate how much $ I have on a daily commuter pass

    This is a pass that gets daily deductions and then automatically reloads with a fixed amount
    when the pass value drops below a set value

    I.E. the card will reload with $30 when the value is <$20

    is there a way for excel to automatically add 30 to ANY cell when the value of the cell is <20?

    I attached a part of the workbook
    the red cells are the ones I need to have 30 added to, and I want that to happen automatically

    Thanks for your help
    Attached Files Attached Files
    Last edited by achaudhri; 02-01-2023 at 06:44 PM. Reason: Adding Workbook

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: How to add a fixed value to ANY cell in a chart based on a fixed condition

    In "straight" Excel, you cannot have both a formula and data in the same cell. It's going to take VBA.

    In the attached, you set the fare ($2.75) and some starting amount. The trip information is contained in an excel table. Also is an excel table for holidays. Since both of these are tables, they grow and copy down formulas as they are added automatically.

    I have a bunch of helper cells to help show the logic. These can be hidden.

    Enter in as many dates in the first column of the table as you want. The week day is the number of the day of the week, Mon =1, Sat = 6 and Sun =7. Weekend is when the week day > 5 (Friday) or if it is a holiday in the green table. This value determines if a fare is used on that day.

    From there, "straight excel" does the calculations. This produces negative numbers. Until you click the button. Then the VB code takes over and if the balance from work is less than 20, $30 is added to that balance and goes into the replenish column. This recalculates the rest of the cells.

    Under this scenario, you replenish twice in February on the 9th and again on the 22. You have 37.50 left over at the end of the month.
    Attached Files Attached Files
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

+ 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. Replies: 8
    Last Post: 11-23-2017, 01:45 AM
  2. Pie Chart with Fixed Area (size, volume?) based on Linked Cell
    By UHD in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 07-17-2017, 01:53 PM
  3. Replies: 13
    Last Post: 10-13-2015, 04:17 AM
  4. [SOLVED] Fixed Cell Reference Minus a Fixed Number
    By juddykong in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-03-2013, 03:25 PM
  5. Fixed Width Text to Excel with fixed break lines.
    By jameel30 in forum Word Formatting & General
    Replies: 1
    Last Post: 08-10-2012, 08:57 PM
  6. Loan Calculator with Terms based on Fixed Payment not a fixed time frame.
    By cc4digital in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-03-2012, 04:49 AM
  7. Replies: 2
    Last Post: 11-22-2011, 12:33 PM

Tags for this Thread

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