Assigning a Numeric Value in a Cell Based on Text in Another Cell

In advance, thanks for your assistance. I'm trying, in vain, to assign a numeric value in a cell based on text (from a dropdown menu) in another cell. For example, in cell A5 I have a dropdown list that includes the options "blue", "red", "white", and "gold." I want cell C15 to be 2 if A5="blue"; I want C15 to be 0 if A5="red"; I want C15 to be 2 if A5="white"; and, I want C15 to be 1 if A5="gold."

Tippet,
This is a job for LOOKUP.
The expression for the Result cell is: =LOOKUP(A2, Lookup :: A1:A4, Lookup :: B1:B4)
The aux. table contains the matches that you assign for the colors.
Regards,
Jerry

Similar Messages

  • Changing Date in one cell based on text in another cell

    Is there a formula to change the date in a cell in one column to the date in another column on the same row based on the text in a third cell on the same row? For example, I want the date in G3 to change to the date in J3 when the text in H3 says Completed.

    Hi,
    My understanding is that if the value of H3 is "Completed", the G3 is changed the value of J3, is it correct? If yes, we can use If formula (=IF(H2="completed",J2)), please see the image below:
    If no, please share us a sample, we'd like to re-try it.
    Regards,
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Conditional format of one cell based on contents of another cell

    Preparing list of appointments for visitors with time for each. There are four possible status categories for visitors based on projected activity and whether they have shown up or not. (A Group Scheduled, A Group Showed, B Group Scheduled, B Group Showed). I've created the calendar in iCal with different calendars, then accessed that through Bento iCal Events. Bento adds the column with name of calendar from iCal. Info is now in Numbers. (iWorks 09)
    It shows Title, Start Date, Location, Calendar. I'm adding more fields using Lookup in Numbers drawing on entire data base brought over from Bento. I'm trying to get what info I need, but none that I don't, so the form isn't too crowded and busy.
    I would like to be able to conditionally format the Time column based on the contents of the Calendar column. If successful, the color of the Time column would tell me all I need to know about visitor status, and I could hide the Calendar column and clean up the form.
    I hope I've described it adequately. Can this be done, and if so, how?
    Thanks! Have a great Thanksgiving!

    jpcranch wrote:
    Does it work to format two cells based on contents of one of them?
    Conditional formatting of a cell depends on the contents of that individual cell, compared with another value, so no.
    But you could use a two-table approach.
    In general terms, the technique is to:
    • make the original table's cell fill transparent,
    • Add a second table to the sheet,
    • Set the second table to copy the control values into a column of cells,
    • Select the cells in that column of Table 2,
    • Apply conditional formatting rules for each possible control value (see below)
    • Set the text opacity for these cells to 0 (full transparency),
    • Click on Table 2 in the sidebar, then use (shift and) the arrow keys to slide Table 2 behind Table 1 to align the highlighted cells with the cells to appear highlighted in Table 1.
    • Set the colour of the cell borders on table 2 to none.
    Using the information you gave regarding the calendar column, you'll need four rules for conditional formatting of this column. All are of the same format:
    Text contains: A Group Scheduled
    With the text changed to match each possible entry.
    Regards,
    Barry
    BTW: by changing the width of the formatted column on table 2, you can appear to highlight as many columns as you wish on Table 1.

  • Assigning a numerical value to the answers of a multiple choice text field

    I have searched and searched thru a million articles but there does not seem to be a simple way to do this, and I hope like heck that I am just overthinking it.  I tend to fall back on years of coding and completely miss a simple answer when doing this
    kind of thing so I hope someone can help.
    I'm developing a scorecard.  I have a list that has a form on it that asks a series of questions on it.  Some are yes/no.
    I want to assign the numerical value of "1" to "yes", and "0" to "No".
    This is so that when I create the actual scorecard, I can add up all the answers and generate a calculated score.
    Example:
    Was this incident properly classified?
    [Dropdown]
    Yes
    No
    Do I need an extra column assigning the values?  Can I assign the values within the column itself? Any assistance will be really helpful. 

    there are several options:
    - calculated column with something along the lines of =IF([dropdowncolumn] = "YES", 1, 0)
    - separate lookup list with values
    - if you're using infopath, your column could be numeric, and just use a DropDown as the visualization, and populate the DDL with key/values of "Yes"/1 and "No"/0 (though in this case, when viewing the list as a native grid, the column
    would only show 1/0, not "yes / no"
    - depending on how you're creating the scorecard, use a yes/no (boolean) column and just convert during the calculation
    lots of options come to mind.
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • Can't assign a string value to a member of type TEXT in Calculation Manager

    I can assign a string value to that member of type TEXT using a run-time prompt of type StringToNumber.
    Example: "My Text Member" = {string_rtp};
    However, I need to accompllish the same function without using a run-time prompts.
    I have a planning application and I know that text along with all other non-numeric
    values are stored on the relational side in the planning application schema.
    It seems reasonable to assume that if this can can accomplish
    with a run-time prompt that I could do also do it without a run-time prompt.
    What appears to be lacking is a function like:
    "My Text Member" = @StringToNumber(<String Literal>);
    Clearly, this is already being done "under the covers" for run-time prompts. If
    would appear to be a minor enhancement to expose such a function to developers.
    NOTE: I suppose you would also need to add new syntax/function to identify a string
    literal from say a member name. I'm wondering if this is the more difficult challenge
    from a product perspective????

    When executing a Calculation Manager rule in Planning, the run-time prompt (RTP) is populated by looking up the outline information present in the relational Planning application database. If the RTP is of type TEXT, the strings displayed in the member select are from the from the relational Planning application database too. Subsequently when executing the Rule, the RTP's value is in fact the record ID (a number) which is then saved into the appropriate intersection in Essbase.
    You need to bear in mind, the Rule is executed in Essbase. If Essbase needs to "write" a text, it would then need to connect to the Planning relational database to create a new record. The newly created record ID then needs to be feed back to Essbase, in order to store it in the appropriate intersection.
    What you are suggesting, comes with a big overhead causing Essbase and the rule to slow. Thus, the disadvantages outweighs the advantages.

  • If Number = than then display text from another cell

    Hi
    I'd appreciate it if anyone can help me with this please.
    I am putting together a gradebook type spreadsheet. I would like to display the text from another cell if the number entered in another cell is greater than or less than a certain number.
    So - if the number in cell A is equal to or greater than 70 then the text displayed in cell B equals the text contained in cell C
    Hope this makes sense.
    Many thanks in advance.
    regards,

    Hello Lee,
    The Numbers User Guide PDF available from the Numbers Help menu as a download is good reading for beginners. As a reference document, the iWork Formulas and Functions User Guide is also valuable.
    The function you need is called "IF", and the syntax is: IF "logic-expression" is true, then do this, else do this. As a calculation in a cell, that would have the form: =IF("Cell A" is equal to or greater than 70, then display the content of cell C, else display "something else") You need to provide the "something else", which can be a null string, "", if you wish.
    As you will find when you read the guide, the cells all have row and column address components where the column is identified by a letter of the alphabet and the row by a number. So If your data is in A1, your text string in B1 and your expression is in C1, you would write in C1:
    =IF(A1>=70, B1, "")
    Does this help?
    Jerry

  • When I add a date to a cell, how can I let another cell display a date that is 30 days later?

    when I add a date to a cell, how can I let another cell display a date that is 30 days later?

    =[cell reference] +30

  • Drag the contents of a cell and drop it into another cell

    dear frankson,
    pls send the source code for drag the contents of a cell and drop it into another cell.

    When I drag and Drop on a Mac (OS 10.2.3), the OS
    builds a transparent image of the component being
    dragged and uses it instead of the default cursors.
    This wouldn't be a big problem except that the
    component it renders is the ENTIRE spreadsheetThis is the default behavior on Mac. You can manually set the dragimage in startdrag(...) in dragGestureRecognized(). So you just need to create an image of what your are actually dragging.
    If you simple want to remove the image just set it to some 1x1 pixel image or a transparent gif...

  • How do I get a cell to sum 1.25*40 + 3.75, but only if I put text in another cell?

    Hi
    How do I get a cell to sum 1.25*40 + 3.75, but only if I put text in another cell?
    Many Thanks
    Jared

    If B2="" doesnt seem to capture it properly you can also try ISBLANK(B2)  or Trim(B2)=""
    one more thing, dont forget about order of operations,
    1.25*40+3.75, are you meaning (1.25*40)+3.75? Or 1.25*(40+3.75)? Two completely different solutions.
    The way it is written you are going to get the first every time, 53.75. If its always the same equation, why do the math?
    Thanks
    Jason

  • How do I assign a numerical value to text cells in cartesian products?

    Hi, this is more of a two part question.
    Question 1
    I need to be able to assign numerical values (Table Value £ of set up) to text cells (Set Up).
    1. The table "Combinations" then uses the formula
    IF($A3≤Information::$B$8, MOD(INT((ROW(cell)−3)÷PRODUCT(C$1:$G$1)), B$1), "")
    to take info from the "Information" table and create all possible permutations of "Set Up"
    2."List" is the printed list of "Combinations"
    3."Output of list" concatenates the data from "List".
    Question 2
    4. How do I print out the total numerical value of the concatenated string of "Output of List" into Output (£) of List"?

    >
    When posting code or code snippets. HTML/XML or input/output, please use the code tags. The code tags help retain the indentation and formatting of the sample. To use the code tags, select the sample and click the CODE button.
    Here is how the first code snippet would have appeared in code tags.
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    float num1, num2, num3, result;
    num1 = Float.valueOf(jRadioButton1.getMnemonic());
    num2 = Float.valueOf(jRadioButton2.getMnemonic());
    num3 = Float.valueOf(jRadioButton3.getMnemonic());
    result = num1+num2+num3;
    jTextField1.setText(String.valueOf(result));And while I'm on the subject of retaining the indentation of the original sample, please use one of the two common conventions for indenting code blocks. E.G.
    Convention 1:
    class TheClass {
        TheClass() {
    }Convention 2:
    class TheClass
        TheClass()
    }

  • Assigning a numerical value

    I am new to Acrobat and still have not figured out a few things. I am trying to make a very simple form for my boss. Basically an inventory sheet with calculations. He is basically looking for an excel spreadsheet in Acrobat. Is this possible? I need to assign a dollar value to a field. One that the client can not change and one that apprears always. The basic formula would be A(field1)*B(field 2) = sum (field 3)
    I dont even know if I am explaining this right. ARG. All help appreciated! Cheers

    Hi again!
    Thank you again for all the help. I have completed my form but am having 1 more problem. I hope I explain this properly:::  My form works almost perfectly. ie:: enter quantity of item. $ amount gets tallied at the end based on quantity. Sub-total amount is correct BUT when sub-total gets HST multiplied to it I am consistently out by $39. I have no idea where this number is coming from.
    My formula for my total is (subtotal*HST)
    My formula for my HST $ amount is default value: 0.12 Format:Percentage
    My formula for Total is (subtotal+HST)
    Also when I am entering quantity the total will not calculate the HST until you enter a 2nd quantity amount. Which it is still under by $39, although if you enter a "0" quantity amount after this it will calculate the formula perfectly.  Same goes with clearing the sheet:: you can clear all the numbers off and it still will have $39 left on the "bill" but if you enter a "0" and then erase it, it clears the sheet perfectly. Is this a glitch or am I not doing something? Thank you for your help in advance.

  • Can one assign a numerical value to a variable?

    Hi All,
    Good afternoon,
    I am currently working on a form that has strings as values in 2 different listboxes, and depending on what is selected a message pops up. Here is the script I wrote, but it does not seem to work right
    var a=aKlaclistbox.raWvalue=="SSK";
    var b=bZlaslistbox.raWvalue=="SGT";
    a.value=1;
    b.value=2;
    if(a > b){
        xfa.host.messagebox("You cannot select a lower officer as the rating officer");
    It does not work, and I am just wondering if there is any way I can get around it so that I can compare the values. I need help from anyone on this forum.
    Thanks
    v/r
    Tammy

    There's probably a better way of doing this, as, depending on how many ranks you have, it could get cumbersome. Like using an array or something like that but not sure how to accomplish that.
    If there are a lot of ranks to compare I think I'd suggest reworking things so that you can use the numeric value of the list box, it will be much easier in the long run.
    As I mentioned above, I don't think the following is valid code:
    var a=aKlaclistbox.raWvalue=="SSK";
    Nor is (unless dealing with global variables):
    a.value=1;
    I think you need to do something like the following (hopefully someone else around here might have a better idea!):
    var a;
    var b;
    if (aKlaclistbox.rawValue == "SSK") {
         a = 1;
    if (bZlaslistbox.rawValue == "SGT") {
         b = 2;
    //You would need a series of else/if with the above to map the different rank values.
    if (a > b) {
       xfa.host.messagebox("You cannot select a lower officer as the rating officer");

  • Does SSRS dynamically set the alignment of table cells based on the majority of cell types in the column???

    This is the first time I've run into this, but it appears that SSRS is setting the text-align based on the other cells in the column.  I have cells being set with either a dataset item of type System.Double or to "--" when Is Nothing evaluates
    to true.  I never noticed before that if the majority of the cells in the column are Nothing, then the few that aren't Nothing get aligned to the left along with all of the "--" text items.  And now I also see columns where the opposite
    is also happening, where if the majority of the cells in the column are numeric values, then everything is aligned right, even the few "--" items there.  I'm only using Default TextAlign and VerticalAlign, and no Indent, SpaceAfter or SpaceBefore,
    nor any concatenated text or embedded preserved spaces.
    Has anyone else in the SSRS universe seen this, and does anyone know why or have a good workaround for it?
    Thanks in advance : )

    Are you viewing the report in html format or are you looking in some other format like Excel,CSV etc?
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • TableView cellfactory set style based on content from another cell

    I'm trying to figure out how to set the color of the current cell based on the content from another cell or property in the class that contains the row content. I looked at the following thinking I can use this but the table position method is not longer there.
    ((Person) t.getTableView().getItems().get(t.getTablePosition().getRow())).setLastName(t.getNewValue()); // from a oracle tableview javafx example
    I would like to:
    if (((Person) t.getTableView().getItems().get(t.getTablePosition().getRow())).getRowError())
    cell.setStyle("..."); // Set the color of the cell content
    Is there away to get the underlying object from the setcellfactory call method?

    Does
    t.getTableView().getItems().get(getIndex())give you access to the object represented in the current row? The getIndex() method is a TableCell method (inherited from IndexedCell).

  • Send numeric value in relative time format to text file

    Hi, I'm trying to send a numeric value to a text file (.txt). However, this value must be in Relative Time format, which is displayed correctly in my front panel but not in my text file. The text file displays  it as an integer-.
    I know that this can be achieved by sending a string instead of a numeric value, but the thing is, I'm sending other numeric values along with this one, which means ALL the data must be numeric in order for Labview to send it, since it does not seem to accept a polimorphic array of data.
    Any suggestions?

    Here the resaved Write to Spreadsheet File.vi for writing String arrays.
    - Partha
    LabVIEW - Wires that catch bugs!
    Attachments:
    Write To Spreadsheet File_String.vi ‏58 KB

Maybe you are looking for