+ Reply to Thread
Results 1 to 4 of 4

Assigning values to text cells

  1. #1
    Registered User
    Join Date
    06-04-2012
    Location
    Orlando FL.
    MS-Off Ver
    Office 2010 Professional Plus
    Posts
    1

    Assigning values to text cells

    Hello

    I'm in the middle of creating a poll database for the upcoming election and i'm having issues when trying to do cretin calculations.

    The polls i'm using each use A (Adults), RV (Registered Voters) and LV (Likely voters). I have a column dedicated to these for each poll.

    I want to assign values for these three variables so when i do calculations, the formula can be referenced to the cell where either A, RV or LV is written and apply either *.3, *.6 or *.9 depending on the text.

    I've tried Define Name and I haven't gotten it to work, and i don't think the IF function would be the right function to use in this situation.

    IS there any way i can do this?

    Thanks in Advance.

    P.S. If you want to see the data i'm referring to, visit polldata.ladakn.com
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    04-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    547

    Re: Assigning values to text cells

    There is no formula in your workbook. What are you trying to achieve?

    Is *.3 etc supposed to be a number or text? You need to explain a bit more.

    In general, you could use

    =lookup(A1,{"A","LV","RV"},{0.3,0.9,0.6})

    If A1 contains "LV" then the formula will return 0.9. Note that {"A","LV","RV"} must be sorted ascending.

  3. #3
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Assigning values to text cells

    Named Range didn't work?

    type in cell

    A1 - 0.3
    A2 - 0.9
    A3 - 0.6

    Select A1 - click Formulas - Define Name ** Name it as " A "
    then next cell A2 Define Name as "LV"
    then next cell A3 Define Name as " RV"

    in A4 formula =A + LV + RV you'll get 1.8

    but i suggest using above formula of npamcpp for other computations to avoid long "ifs"
    =if(a1=""A", A+10,if(A1="LV"..........
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  4. #4
    Valued Forum Contributor
    Join Date
    04-30-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    547

    Re: Assigning values to text cells

    If you want to use defined names, you don't need to enter the values into the spreadsheet first, if they are constants. Just define a name and in the "Refers to" box, put the value that you want that name to refer to.

    Again, please describe what you want to achieve. Even with defined names, it sounds as if you need to evaluate a cell before deciding which name to use.

    If you have defined names in place and a value of 0.3 assigned to the defined name "A" etc, and in A1 you have the text "A", then you can do things like

    =indirect(A1)

    This will return 0.3

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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