+ Reply to Thread
Results 1 to 8 of 8

Can a cell contain a formula and be used for data entry?

  1. #1
    Registered User
    Join Date
    11-06-2014
    Location
    Alabama
    MS-Off Ver
    Office 365, Office 2013
    Posts
    26

    Can a cell contain a formula and be used for data entry?

    I have a spreadsheet that the field guys will enter inches. Is there a way to embed a formula in the data entry cell that will automatically change it to feet? My general knowledge is that if you have a cell with a formula the formula is replaced when you enter data.


    Thanks!

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Can a cell contain a formula and be used for data entry?

    You are right, as soon as you enter data in a cell, it replaces any previous content.

    You have a choice:
    - You could use a separate cell containing a formula to convert inches to feet
    - You could use a small bit of VBA to convert the value from inches to feet within the changed cell

    VBA Example:
    If we assume your users will enter inches in range A2:A100, then the following code in the worksheet module will convert inches to feet as soon as data is entered:
    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    11-06-2014
    Location
    Alabama
    MS-Off Ver
    Office 365, Office 2013
    Posts
    26

    Re: Can a cell contain a formula and be used for data entry?

    Jus to make sure I am fully understanding. With that VBA code embedded in the sheet, any data entered in that range will perform the calculation and convert inches to feet? What if I wanted to apply it to multiple ranges? Do I separate with commas inside the quotation marks?

    Thanks!

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Can a cell contain a formula and be used for data entry?

    Yes, with that code, anything entered in the specified range will be "changed" as soon as data is entered.

    If they're entering text, not values, that changes the code a bit, as does applying it to multiple ranges.

    Easiest to make the necessary changes if you attach a sample workbook showing the ranges you want to consider, and what the input text will look like.

  5. #5
    Registered User
    Join Date
    11-06-2014
    Location
    Alabama
    MS-Off Ver
    Office 365, Office 2013
    Posts
    26

    Re: Can a cell contain a formula and be used for data entry?

    I cant really provide a sample of this workbook, my company is overzealous with privacy and security. The ranges would be J and K (for now) row 52-89.

    Thanks!

  6. #6
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Can a cell contain a formula and be used for data entry?

    In what format will the inches data will be entered?

  7. #7
    Registered User
    Join Date
    11-06-2014
    Location
    Alabama
    MS-Off Ver
    Office 365, Office 2013
    Posts
    26

    Re: Can a cell contain a formula and be used for data entry?

    Ok, I've mispoken a bit. I want the result in inches and they enter it in feet/inches. So sorry about that, was a little distracted this morning. The way I have it now there are two cells, one for feet and one for inches then a cell that takes those two numbers and converts it all to just inches. They are on a very busy schedule so they want it to be as easy to enter as possible, which is why they dont just figure it in inches to start with.

  8. #8
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Can a cell contain a formula and be used for data entry?

    So you just need a formula in the third cell - e.g. if Feet number is in J52, and Inches number in K52, then in L52:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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. Can I have a formula but allow data entry in same cell?
    By durallymax in forum Excel General
    Replies: 2
    Last Post: 02-16-2012, 01:05 PM
  2. Replies: 2
    Last Post: 08-30-2011, 03:40 PM
  3. Can I do this? cell data entry that returns a formula value
    By jasonr704 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-14-2006, 06:36 PM
  4. Replies: 7
    Last Post: 07-29-2006, 11:30 AM
  5. [SOLVED] Formula and Data Entry in a Single Cell
    By Josh VM in forum Excel General
    Replies: 1
    Last Post: 10-21-2005, 05:05 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