+ Reply to Thread
Results 1 to 2 of 2

A smart table that autofills row values regardless of the input cell

  1. #1
    Registered User
    Join Date
    07-20-2017
    Location
    Singapore
    MS-Off Ver
    MS Office 2016
    Posts
    1

    A smart table that autofills row values regardless of the input cell

    Hi all,

    I am looking for a method to get excel to automatically calculate the values for a row of cells regardless of where I input my data.

    For example, say I have a 1 x 3 table calculating the total cost of something.

    Column 1 specifies the number of objects, column 2 specifies the unit price, and column 3 specifies the total cost.

    Number Price Total
    2 $3 $6 (calculated)


    Normally, I would put a formula in the third column: "=A1*B1". I would input the number of objects and the unit price, and have the total cost calculated automatically by the formula.

    However, I want to make it such that I can input data not restricted to the number and the unit price. Sometimes, I may only have the total cost and the number of units, or the total cost and the unit price, and I want to find out the missing column. Is there any way that I can program excel such that I can get it to auto fill the table regardless of what data I input to it?


    Number Price Total
    20 (calculated) $4 $80

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: A smart table that autofills row values regardless of the input cell

    A cell can contian either a value or a formula. But if you type a value into a cell that contains a formula, the formula will get deleted.
    Same goes for entering a formula in a cell that already contains a value.

    You could do it via VBA or this way:

    Enter your data in columns D E and F with your actual results in columns A B and C
    Once you have entered two values in D E F the third can be calculated

    in A1
    =IF(COUNTA(D1:F1)<>2,"",IF(D1="",F1/E1,D1))
    in B1
    =IF(COUNTA(D1:F1)<>2,"",IF(E1="",F1/D1,E1))
    in C1
    =IF(COUNTA(D1:F1)<>2,"",IF(F1<>"",F1,D1*E1))
    and copy down the columns

    Now when you enter two values in columns D E and F, columns A B and C will calculate the values as you've described.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

+ 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. Creating a worksheet that autofills values
    By jmlovetto in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-07-2017, 01:41 PM
  2. Get values from input table to add data in output table depending on header
    By SBBmaster09 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-16-2016, 03:25 AM
  3. Replies: 3
    Last Post: 07-30-2015, 10:33 PM
  4. Extract cell of a table when multiple input values match
    By sash5 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-16-2015, 05:19 AM
  5. User Input Description to SKU 'Smart Code'
    By twistedweb in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-07-2014, 02:04 PM
  6. need a smart lookup on mutliple values within 1 cell
    By Watney99 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-14-2013, 04:29 PM
  7. Replies: 2
    Last Post: 12-14-2012, 01:17 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