Guidance needed...cell value based on list?

I'm trying to populate a cell based on a list of possible values and a count result from another cell. Short of making a big ugly if(), is there a way to do this? Here's an example of what I'm trying to do:
Cell A (count result): 5
List:
1 = 1.25
2 = 2.5
3 = 5
4 = 9
5 = 16
Cell B (result): 16

K,
I like to handle problems such as yours with two tables, one to place the input and receive the output, and the other contains your data. An auxiliary column is added to the data table with the numbers 1, 2, 3, ... to refer to the values you want to select.
The second is a four cell table including headers. Enter the number you want in A2 and the matching value appears in B2. Formula for cell B2 is:
=LOOKUP(A2,Table 1 :: Aux,Table 1 :: List of values)
pw

Similar Messages

  • Popup need attributes value based on row selected in table

    When a row is selected in a table, how can we pass multiple attributes to a pop-up corresponding to that particular row?
    Suppose, there is a link in every row of table corresponding to that particular row and when ever a user click to that particular link , a popup should be displayed. Requirement is I want to pass multiple attributes to that pop-up based on the selected row. How is it possible, any suggestions please? Like I want to pass a person location id , person country id, person id and person manager id?
    Thanks in Advance...

    Hi,
    Welcome to OTN. Always mention your JDev version and technologies used (read through this announcement : https://forums.oracle.com/forums/ann.jspa?annID=56)
    If your table and popup is on the same jspx page, you can drop the same datacontrol as table (or read-only table) and again drop the same as form (editable / read-only based on your requirement) inside the popup as well.
    -Arun

  • Return a value based on multiple criteria

    Dear Support Community,
    I am trying to formulate a function so that I am able to return a cell value based on more than one criteria.
    Referring to the attached screen shot, "Local Start Time" refers to the time that a person will start a work shift, and depending on the "sectors" the person's duration of time at work will vary.
    For example, if a person starts work between 07:00am and 07:59am AND the particular shift involves 2 sectors, the allowed time at work is 12H15M. However, given the exact start time, if the shift only involves ONE "sector' the allowed time at work becomes 13H00M etc.
    I am trying to formulate a function whereby I can tell the spreadsheet the local start time AND sectors, and then have the appropriate time returned.
    I hope the above makes sense!
    Thanks
    ST

    Hi ST,
    Print your table and pin it up as a "Ready Reckoner" for humans to refer to.
    Convert your table into a Database, something like this:
    Start
    Finish
    Sectors
    Allowed Duration
    Scenario
    0700
    0759
    1
    13h 0m
    1
    0700
    0759
    2
    12h 15m
    2
    0700
    0759
    3
    11h 30m
    3
    0800
    1259
    1
    14h 0m
    4
    0800
    1259
    2
    13h 15m
    5
    0800
    1259
    3
    12h 30m
    6
    1300
    1759
    1
    13h 0m
    7
    1300
    1759
    2
    12h 15m
    8
    1300
    1759
    3
    11h 30m
    9
    1800
    2159
    1
    12h 0m
    10
    1800
    2159
    2
    11h 15m
    11
    1800
    2159
    3
    10h 30m
    12
    2200
    0659
    1
    11h 0m
    13
    2200
    0659
    2
    10h 15m
    14
    2200
    0659
    3
    9h 30m
    15
    (You may want to check that I have converted correctly)
    Columns A and B have a Custom Format that allows them to be numbers (not Text) with leading zeroes.
    Hide Separator to get rid of the comma
    Show zeroes for Unused Digits to show leading zeroes.
    Then you can enter "Army Time" (24 hour clock with leading zeroes) into a Query table
    Thunderstorms playing havoc here with my internet connection. I will post this now. Watch for the next instalment.
    Regards,
    Ian

  • SQL Server Reporting Services- Coloring a Cell Background Based on two different column group values

    Hello All,
    I have a matrix report with time scale on the x axis  and Resources on Y axis Showing the tasks assigned to each resource for a period of time. Here I have to color a matrix cell showing task details on tool tip with background color of the cell.
    So Please help me on this.I have a expression like this...
    In my case the color should be filled for the cell with name "Fields!task_name.Value" based on the values of "Fields!Day_Wise.Value " where we have the values for Daywise as S,M,T,W,T,F,S. So i need the background for the cell with name
    task_name as Light Grey on Friday and Saturday, But we have the same name S for sunday also, which should come in different color.
    =iif(Fields!Day_Wise.Value ="F","LightGrey",
    IIF(PREVIOUS(Fields!Day_Wise.Value) ="F","LightGrey",
    iif(Fields!task_name.Value="","White",
    iif(InStr(Fields!task_name.Value,"||")>0,"Maroon",
    iif(InStr(Fields!task_name.Value,"NULL")>0,"Sienna",
    iif(InStr(Fields!task_name.Value,"Pink")>0,"Pink",
    iif(InStr(Fields!task_name.Value,"Red")>0,"Red",
    iif(InStr(Fields!task_name.Value,"Purple")>0,"Purple",
    iif(InStr(Fields!task_name.Value,"Green")>0,"Green",
    iif(InStr(Fields!task_name.Value,"White")>0,"White",
    iif(InStr(Fields!task_name.Value,"Cyan (Teal)")>0,"Teal",
    iif(InStr(Fields!task_name.Value,"Olive")>0,"Olive",
    iif(InStr(Fields!task_name.Value,"Blue")>0,"Blue",
    iif(InStr(Fields!task_name.Value,"Light Blue (Aqua)")>0,"LightBlue",
    iif(InStr(Fields!task_name.Value,"Yellow")>0,"Yellow","Black"
    Thanks
    AJ Hameed

    Hi AJ Hameed,
    According to your description, you want to set the background color for the cells based on the values inside of cells and the values the column group. You want to set grey for cells on Friday and Saturday, set colors based on the task name on other weekdays.
    Right?
    In Reporting Services, there's no problem if we have two different data values in conditional expression, so we can set background color based on Day_Wise or task_name. One issue in this scenario is, we can't have value "S" for both Saturday and Sunday when
    working in a matrix. Otherwise the task_name will overwrite the previous task_name (for numeric values, it will do sum calculation). So we suggest you change the values for weekdays in database. The expression you have posted was correct. It only has a small
    issue: the "Light Blue(Aqua)" also contains "Blue", so when doing conditional judging, the expression will return "Blue" instead of "Light Blue". We have tested in our local environment. For viewing convenience, we used the Switch() function in our expression:
    =IIf(Fields!Day_Wise.Value="Fri" or Fields!Day_Wise.Value="Sat","LightGrey",
    Switch(
    InStr(Fields!Task_name.Value,"White")>0,"White",
    InStr(Fields!Task_name.Value,"||")>0,"Maroon",
    InStr(Fields!Task_name.Value,"Pink")>0,"Pink",
    InStr(Fields!Task_name.Value,"Red")>0,"Red",
    InStr(Fields!Task_name.Value,"Purple")>0,"Purple",
    InStr(Fields!Task_name.Value,"Green")>0,"Green",
    InStr(Fields!Task_name.Value,"Cyan(Teal)")>0,"Teal",
    Fields!Task_name.Value="","White",
    InStr(Fields!Task_name.Value,"Olive")>0,"Olive",
    InStr(Fields!Task_name.Value,"Blue")>0,"Blue",
    InStr(Fields!Task_name.Value,"Aqua")>0,"LightBlue",
    InStr(Fields!Task_name.Value,"Yellow")>0,"Yellow",
    InStr(Fields!Task_name.Value,"Orange")>0,"Orange",
    InStr(Fields!Task_name.Value,"Null")>0,"Sienna",
    true,"Black"
    The result looks like below:
    Reference:
    Matrices (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • Custom itemRenderer component based on cell value: error 1009

    I'm working on an item renderer for a dataGrid that has different states depending on the cell and row values.
    The cell value is a toggle (true or null), and sets whether content should be shown in the cell or not
    The row properties determine what is shown when the cell value is true.
    The dataGrid dataProvider is populated based on user id input.
    I created the itemRenderer as a custom actionscript component, closely following this example:
    360Flex Sample: Implementing IDropInListItemRenderer to create a reusable itemRenderer
    However, my component results in Error #1009 (Cannot access a property or method of a null object reference) when a user id is submitted.
    package components
         import mx.containers.VBox;
         import mx.controls.*;     import mx.controls.dataGridClasses.DataGridListData;
         import mx.controls.listClasses.BaseListData;
         import mx.core.*;
         public class toggleCellRenderer extends VBox
              public function ToggleCellRenderer()
              {super();}
              private var _listData:BaseListData;   
                   private var cellState:String;
                   private var cellIcon:Image;
                   private var imagePath:String;
                   private var imageHeight:int;
                   private var qty:String = data.qtyPerTime;
                   private var typ:String = data.type;
              public function get listData():BaseListData
                   {return _listData;}
              public function set listData(value:BaseListData):void
                   {_listData = value;}
              override public function set data(value:Object):void {
                   super.data = value;
                   if (value != null)
                   //errors on next line: Error #1009: Cannot access a property or method of a null object reference.
                   {cellState = value[DataGridListData(_listData).dataField]}
              override protected function createChildren():void {
                   removeAllChildren();
                   if(cellState=='true'){
                        cellIcon = new Image();
                        addChild(cellIcon);
                   //there is another state here that adds another child...
              //next overrides commitProperties()...
    There are no errors if I don't use an itemRenderer--the cells correctly toggle between "true" and empty when clicked.
    I also tried a simple itemRenderer component that disregards the cell value and shows in image based off row data--this works fine without errors or crashing. But I need to tie it to the cell value!
    I have very limited experience programming, in Flex or any other language. Any help would be appreciated.

    Your assumption that the xml file either loads with "true" or nothing  is right.
    After modifying the code to the following, I don't get the error, but it's still not reading the cell value correctly.
    package components
         import mx.containers.VBox;
         import mx.controls.*;   
         import mx.controls.dataGridClasses.DataGridListData;
         import mx.controls.listClasses.BaseListData;
         import mx.core.*;
         public class toggleCellRenderer extends VBox
              public function ToggleCellRenderer()
               super();
              private var _listData:BaseListData;   
              private var cellState:Boolean;
              private var cellIcon:Image;
              private var imagePath:String;
              private var imageHeight:int;
              private var qty:String;
              private var typ:String;
               public function get listData():BaseListData
                 return _listData;
              override public function set data(value:Object):void {
                   cellState = false;
                   if (listData && listData is DataGridListData && DataGridListData(listData).dataField != null){
                       super.data = value;
                       if (value[DataGridListData(this.listData).dataField] == "true"){
                           cellState = true;
              override protected function createChildren():void {
                   removeAllChildren();
                   if(cellState==true){
                        cellIcon = new Image();
                        addChild(cellIcon);
                   //there is another state here that adds another child...
              //next overrides commitProperties()...
    - didn't set the value of qty or typ in the variable declarations (error 1009 by this too--I removed this before but wanted to point out in case its useful)
    - added back in the get listData() function so I could use the listData
    - changed the null check
    All cells are still returning cellState = false when some are set to true, even if I comment out [if (value[DataGridListData(this.listData).dataField] == "true")] and just have it look for non-null data. That shouldn't make a difference anyway, but it confirms that all cells are returning null value.
    Swapping out the first if statement in set data with different variables results in the following:
    [if (listData != null)]  all cells return null (cellState=false for all)
    both [if (value != null)] and  [if (DataGridListData != null)]  results in error 1009 on a line following the if, so I assume they return non-null values.
    All rows have data, just not all fields in all rows, so shouldn't listData be non-null?  Could it be that the xml file hasn't fully loaded before the itemRenderer kicks in?
    I also realized  I had removed the item renderer from many of the columns for testing, and since some columns are hidden by default only one column in the view was using the itemRenderer--hence the single alert per row I was worried about earlier.
    Thanks for your help so far.

  • Change background color of a table based on table cell values quickly.

    Is there a more effecient way to change the background color of a table based on the cell values of the table?
    I can do this cell-by-cell using the property node, but it is very slow. It helps a little by deferring panel update, but it is still slow. Is there a better way? 
    Thanks.
    Ian

    If you want to color each cell according to the value, you need to do it one cell at a time and the above answers don't apply.
    You can dramatically speed up things by defering front panel updates for the duration of the operation.
    (sample code can be seen in the top picture here)
    EDIT: I noticed you tried this already. Can you show us your code?
    How many cells need to be colored on average?  If there are not that many, first write the background color using -2,-2, the only write the few cells to be colored, skipping the rest.
    How big is the table? If it is much bigger than the table indicator, all you need is to color the visible parts whenever the data or the scroll position changes.
    LabVIEW Champion . Do more with less code and in less time .

  • JTable Cell Value needs to hided

    Hi,
    I have 5 columns in a JTable. The first column is a checkbox. The second column is non editable. The third, fourth and fifth columns are editable. Whan I click a check box, I am performing a database operation and based on the output, I am setting values to for the column 3, 4 and 5.
    My requirement: I need to perform the database operation only for the first time of the check box click. If I uncheck the checkbox, the values in column 3, 4 and 5 needs to be disappeared. If I check the check box again, I need the values to be visible. Basically, I will do database calls only for the first time. From second time onwards, I need to just hide the text in the particular cells (if the checkbox is unchecked) and make the cell values visible (if the checkbox is checked) In JTable API, there are no methods to hide a cell value or I am unable to figure it out. Please help me.
    Regards
    subbu

    Alirght here is some code. This is a bit messy but I guess the solution is clear. It make use of a combination of renderers, ie the Sun's DefaultTableCellRenderer (for the first column to get the checkboxes) and a custom renderer for the rest of the columns.
    Also, a MouseListener is added so that on clicking the first column, a repaint is forced to ensure the values in the cells disappear.
    * @(#)CheckableRow.java
    * @author icewalker2g
    * @version 1.00 2007/12/27
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.table.*;
    import java.util.*;
    import java.io.*;
    public class CheckableRow extends JFrame {
        public JTable table;
        public DefaultTableModel model;
        public CheckableRow() {
            super("Checkable Row");
            createUI();
        public void createUI() {
            Vector<String> cols = new Vector<String>();
                cols.addElement("Col 1");
                cols.addElement("Col 2");
                cols.addElement("Col 3");
                cols.addElement("Col 4");
                cols.addElement("Col 5");
            Vector<Object> rows = new Vector<Object>();
            model = new DefaultTableModel(rows, cols);
            for(int i = 0; i < 5; i++) {
                Vector<Object> row = new Vector<Object>();
                    row.addElement( false );
                    row.addElement("Data");
                    row.addElement("Col 3 Data " + (i+1));
                    row.addElement("Col 4 Data " + (i+1));
                    row.addElement("Col 5 Data " + (i+1));
                model.addRow( row );
            table = new JTable(model) {
                CellValueRenderer renderer = new CellValueRenderer();
                public TableCellRenderer getCellRenderer(int row, int col) {
                    if(col > 1) {
                        return renderer;   
                    return super.getCellRenderer(row, col);
                public Class getColumnClass(int col) {
                    if( col == 0) {
                        return Boolean.class;
                    return super.getColumnClass(col);
                public boolean isCellEditable(int row, int col) {
                    if( col != 1 ){
                        return true;
                    return false;
            table.addMouseListener( new MouseAdapter() {
                public void mouseClicked(MouseEvent e) {
                    if( table.columnAtPoint( e.getPoint() ) == 0 ) {
                        table.repaint();
            getContentPane().add( new JScrollPane(table), BorderLayout.CENTER );
            pack();
            setLocationRelativeTo(null);
            setDefaultCloseOperation(EXIT_ON_CLOSE);
            setVisible(true);
        public class CellValueRenderer extends DefaultTableCellRenderer {
            public CellValueRenderer() {
                super();
            public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
                boolean hasFocus, int row, int col) {
                DefaultTableCellRenderer renderer = (DefaultTableCellRenderer)
                super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, col);
                if( table.getValueAt(row, 0).toString().equals("true") && col > 1) {
                    renderer.setText("");
                } else {
                    renderer.setText( value == null ? "" : value.toString() );
                return renderer;
        public static void main(String[] args) {
            new CheckableRow();
    }ICE

  • Is it possible to apply conditional formatting to a cell (or range) based upon a LOOKUP query to cell values in another sheet.? I want to alter the formatting (i.e., text and/or cell background color), but not cell content.

    Is it possible to apply conditional formatting to a cell (or range) based upon a LOOKUP query to cell values in another sheet.?
    I want to alter the formatting (i.e., text and/or cell background color), but not the content, of the target cell(s).

    Hi Tom,
    Your LOOKUP formula will return a value that it finds in the "other" table. That value can be used in conditional highlighting rules. (Numbers 3 calls it conditional highlighting, not conditional formatting. Just to keep us awake, I guess, but it works the same).
    Please explain what you are trying to do.
    Regards,
    Ian.

  • Need to split value based on "+"

    Hi All,
    I need to split my input value based on "+" symbol.
    Sample Input Value : 4506407171+4506661488+4506661489+4506548333
    Out put Value 1: 4506407171
    Out put Value 2: 4506661488
    Out put Value 3: 4506661489
    Out put Value 4: 4506548333
    Please suggest a UDF
    Thanks & Regards,
    Mahi.

    Hi Mahi,
    The + sign is a special character and needs to be escaped before splitting. Please see code below:
    UDF: Context Type
    Argument: inp        (String)
    for(int a=0;a<inp.length;a++){
      String tmp[] = inp[a].split("\\+");
      for(int b=0;b<tmp.length;b++){
      result.addValue(tmp[b]);
    Regards,
    Mark

  • Need help in WAD 7.0 - anaylsis item cell value as filter to another web...

    Hi ,
    I need help in WAD 7.0
    i have 2 web items, analyis item 1 & 2
    when user clicks any cell value in column xxx of analysis item1, then i need to filter the analysis item 2 values for  column xxx  , for that user clicked value.
    how do i enable this ?

    Hi.
    You can try the nxt approach:
    1. in analysis item A (first) properties define in "behaviour" -> "row selection" = "single with command".
    2. set this command to "SET_SELECTION_STATE_BY_BINDING".
    3. define "data provider affected" = your second data provider for analysis item B.
    4. in "selection binding" set needed variables to binding type "VARIABLE"
    In this case, when you select any row in analysis item A some variables will be populatd from this row and affect on analys item B (dataprovider B).
    Regards.

  • Is there a way to fill a cell with a value based on the selection from another cell?

    For example: If have a drop down menu created for Cell A1 with options (Dog 1, Cat 2, Bird 3). Is there a way to fill cell A2 automatically when I select from the drop down menu.
    So if I selected 'Cat' in A1, cell A2 would automatically input the 2.

    I suggest an extensible method that allows you to add other animals:
    This method adds a small table called "Animal Lookup" that matches names (same as in the pop-up menu) with a value.
    The table on the left uses this table to retrieve the value based on the animal:
    B2=VLOOKUP(A2, Animal Lookup :: A:B, 2, 0)
    select B2 and fill down

  • Cannot replicate the ring cells' value list on a table

    Hi, 
    I am trying to create a variable-size table/matrix of ring cells. The default value list is "0 (x)" and "1(P)", for binary purpose, specified in cell (1,1). When I insert a new row and/or colum on the table, It looks like the inserted cells does not inherit the specified value list "0 (x)" and "1(P)" from cell (1,1).
    I have also tried the following options, but none of them works.
    (1) change the Table Mode (Edit Table -> Control Settings -> Table Mode) to either "row" or "column" from "grid"
    (2) use the parameter "VAL_USE_MASTER_CELL_TYPE" instead of ring type
    (3) search the forum but not clue found
    Please also see the attached snapshot files, which show how the settings are set.
    (1) "snapshots_02_ring_list.jgp": specify the ring value list of cell(1,1)
    (2) "snapshots_03_edit_default_cell_values.jpg": I tried also to specify the default cell values in Control Settings (Edit Table -> Control Settings -> Edit Default Cell Values -> Ring/Combo Box Attributes), but the button "Value List" is greyed out.
    (3) "snapshot_04_cells.jpg": the created/inserted cells do not have the value lists
    Here is the code piece for your information:
    // insert a few rows
    InsertTableRows(panel,PANEL_TABLE_CHKBRD, (iNumOfRowNow+1),iNumOfRowChange, VAL_USE_MASTER_CELL_TYPE);
    // draw the cells
    ProcessDrawEvents();
    // set the active row
    SetCtrlAttribute(panel, PANEL_TABLE_CHKBRD,ATTR_FIRST_VISIBLE_ROW, iNumOfRowNew);
    Thanks.
    Attachments:
    snapshot_02_ring_list.jpg ‏134 KB
    snapshot_03_edit_default_cell_values.jpg ‏159 KB
    snapshot_04_cells.jpg ‏16 KB

    You cannot inherit the ring values of a cell. This is why the Value List button is dimmed when you edit the default cell values of a column in the UI Editor.
    You can use the InsertTableCellRingItem function to programmatically create the value list of any new cells that you add to the table. Or the InsertTableCellRangeRingItem function, if you want to do the same thing for multiple cells at once.
    By the way, for items that can be inherited (i.e. cell attributes, as Wolfgang put it), inheritance does not happen from one cell to another. Depending on the table mode, inheritance happens from a column's default cell to new cells under that column, or from a row's default cell to new cells on that row, or from the table's default cell to all new cells.
    Luis

  • Want 2 populate value in 2nd list item based on value selected in 1st list?

    Want 2 populate value in 2nd list item based on value selected in 1st list?

    Gaurav -
    The 3rd list will not populate because nothing has been selected yet in list 2. The value in list 2 is null, so the loop to populate list (3) has nothing to load. Try the following below. This should seed your 2nd list so the 3rd list will populate.
    You will have to declare first_record boolean and first_value to match DESCC.
    first_record := true; -- NEW *****
    Clear_List('BLOCK2.ITEM2');
    FOR CurRec IN (SELECT UNIQUE DESCC DESCC FROM LUTT where LUTT.IDD = :BLOCK2.ITEM1)
    LOOP
    if first_record = true then -- NEW SECTION *****
    first_value := CurRec.DESCC;
    first_record := false;
    end if;
    Add_List_Element('BLOCK2.ITEM2',1,CurRec.DESCC,CurRec.DESCC);
    END LOOP;
    :block2.item2 := first_value; -- NEW *****
    Clear_List('BLOCK2.ITEM3');
    FOR CurRec2 IN (SELECT UNIQUE DESCC DESCC FROM LUTT where LUTT.DESCC = :BLOCK2.ITEM2)
    LOOP
    Add_List_Element('BLOCK2.ITEM3',2,CurRec2.DESCC,CurRec2.DESCC);
    END LOOP;
    My name is Ken, 1990 is when I started using Oracle Forms 3.0, character based in the Unix environments. And you are very welcome.

  • Conditional Format based on cell value

    For example; want to turn a cell yellow if its value is less than another cell value.
    Is this possible?
    Conditional format rules don't seem to like cell references.

    There are many ways to call attention to a value that needs to be emphasized because of its relationship to other values. What you decide to do will be influenced by how particular you are about the end result vs. the trouble that you will have to go through to achieve it. When other cells need to reference a cell that may be either text or numeric, you can use the TRIM function, or other text functions, to remove interfering characters. Here's an example, where you can see the last row multiplying the previous, manipulated row, by 2.
    Also, all the cells are formatted as Currency, with to ill effect. In the example I left the cells with the conditional format in default alignment so you could see the added space character against the left margin of the cell.
    I think the easiest way to call attention to a cell is to add an adjacent row of column with a conditional expression that 'lights-up' when there is an alarm condition.
    Jerry

  • Set Radio Group Default Value Based on a Select List Change Event

    Apex 4.2
    I have a radio group that is source is below. It returns 3 radio group item All,Miv,Courier
    SELECT type d, code r FROM vw_lov_depot
      WHERE svc_name = :P320_DEPOT
      ORDER BY 1
    The radio group is only populated when :P320_DEPOT gets a value, this is a select list.
    I am trying to set the radio group to  default to this value Miv it would use the statement
    SELECT type d, code r FROM vw_lov_depot
      WHERE svc_name = :P320_DEPOT
      and type ='Miv'
      ORDER BY 1
    I have tried creating a dynamic action on Select list change to populate the default value of the radio group...no joy I also tried a computation. how can I set this default value on when list changed.
    Thanks
    I have got the default Radio Group Selection working by doing a computation before region on the radio group and calling its select statement and setting the value. But the problem is now I cannot change the radtio group as I do it fire the before region trigger and sets it back to the default value....any help?

    Hi,
    Could you please create example to apex.oracle.com?
    Regards,
    Jari

Maybe you are looking for