+ Reply to Thread
Results 1 to 9 of 9

Use a defined name that represents a number in a function

  1. #1
    Registered User
    Join Date
    11-07-2014
    Location
    watford city, nd
    MS-Off Ver
    2013
    Posts
    4

    Use a defined name that represents a number in a function

    Hi, im working on a spreadsheet right now and im not sure what im doing wrong. i have the word laborer defined as 45 and when the word laborer is present in a cell i want to multiply that cell by the amount of hours they worked. for example in cell a1 it says laborer, i want to use =product(a1,10) and get the result of 450. does this make any sense? Thanks for your help

  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: Use a defined name that represents a number in a function

    Try:
    Formula: copy to clipboard
    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
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Use a defined name that represents a number in a function

    Please Login or Register  to view this content.
    in VBA one can assign a value, but in excel I am not sure

  4. #4
    Registered User
    Join Date
    11-07-2014
    Location
    watford city, nd
    MS-Off Ver
    2013
    Posts
    4

    Re: Use a defined name that represents a number in a function

    I Tried that and it came up with #REF! error

  5. #5
    Registered User
    Join Date
    11-07-2014
    Location
    watford city, nd
    MS-Off Ver
    2013
    Posts
    4

    Re: Use a defined name that represents a number in a function

    okay rcm that worked but can I create a string of if functions? a1 can be several different things; laborer, forman, supervisor, ect

  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: Use a defined name that represents a number in a function

    Quote Originally Posted by nickdh47 View Post
    I Tried that and it came up with #REF! error
    Which sounds like you haven't defined the name accurately.

    See the attached workbook for an example of how it does work.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    11-07-2014
    Location
    watford city, nd
    MS-Off Ver
    2013
    Posts
    4

    Re: Use a defined name that represents a number in a function

    Quote Originally Posted by rcm View Post
    Please Login or Register  to view this content.
    in VBA one can assign a value, but in excel I am not sure
    Quote Originally Posted by Olly View Post
    Which sounds like you haven't defined the name accurately.

    See the attached workbook for an example of how it does work.


    I see what your saying but a1 will not always say laborer it changes depending on what is entered in another cell. I have the name laborer defined as 45 not the cell that its in

  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: Use a defined name that represents a number in a function

    How have you 'defined' laborer as 45? Is it a named range?

    Might be easier to unpick what you're trying to do if you attach your workbook...

  9. #9
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,814

    Re: Use a defined name that represents a number in a function

    Quote Originally Posted by nickdh47 View Post
    okay rcm that worked but can I create a string of if functions? a1 can be several different things; laborer, forman, supervisor, ect
    This is starting to sound to me like a lookup table (see the help file for the VLOOKUP() function for an example of a lookup table: https://support.office.com/en-us/art...rs=en-US&ad=US )
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ 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. Word that represents number?
    By Managerwork in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2013, 05:25 AM
  2. Replies: 1
    Last Post: 06-21-2012, 05:19 AM
  3. Function that uses a defined number to determine range size
    By rogerthatman in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-12-2012, 04:37 PM
  4. Application Defined or Object Defined Error, Command Button and Vlookup Function
    By stevedomer in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-14-2011, 11:20 PM
  5. [SOLVED] user defined function row number
    By bj in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 03-09-2005, 10:06 AM

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