Using Table Name reference in formula results in #VALUE error

In Excel 2010, I have an OLE DB connection that brings in data from an SQL query. Excel automatically created the table reference for this (Table1). The table contains headers and Excel knows this; they are formatted in the table as such.
When I try to use a SUMIF function and ask it to sum the column Table1[Column], I get a #VALUE error. I'm assuming because Excel is including the header in the data, which is a text entry. Otherwise, all the other values in the column are numbers.
I'm currently using a defined named range to get round the issue but I'd like to use the table reference instead because as the SQL data grows and shrinks, so does the table range that Excel performs calculations on.

Hi DPLMartin,
This should not happen, by default the [column] syntax only refers to the data, not to the header. I expect there is one or perhaps more rows which contain text.
Try selecting the column in question and use F5, Special, constants and only leave the "Text" checkbox checked.
Regards, Jan Karel Pieterse|Excel MVP|http://www.jkp-ads.com

Similar Messages

  • How to find the list of un used table names in a schema?

    Hi,
    I have a doubt in Oracle. The doubt is that If we are using any tables in Function Or Proc.... Then...We can list all those used table names from USER_DEPENDENCIES system table. Right...
    But, If the table is used with Execute Immediate Statement, then, those table names are not coming out with USER_DEPENDENCIES system table. Because they are identified at run time and not compile time.
    It is fine. And I agree.. But, If I want to list out those tables also...then...How to do? Any idea?
    I think ‘USER_SOURCE’ system table may not be the right one. If there is any other system table avails for this purpose...then..it would be very grateful to extract right...
    So I am wanting that exact system table.
    Please let me know about this, if you have any idea or check with your friends if they have any idea.
    Regards,
    Subramanian G

    Hi Guys,
    Thanks for all your answers.
    Yes....You are all right. We can list out the used tables upto certain extent. Anyhow, I have done some R&D to derive the SQL's which is given below:
    SELECT TABLE_NAME FROM USER_TABLES
    MINUS
    SELECT DISTINCT UPPER(REFERENCED_NAME)
    FROM user_dependencies
    where
    referenced_type='TABLE' and UPPER(NAME) in
    select distinct UPPER(object_name) from user_objects where UPPER(object_type) in
    'MATERIALIZED VIEW',
    'PACKAGE',
    'PACKAGE BODY',
    'PROCEDURE',
    'TRIGGER',
    'VIEW',
    'FUNCTION'
    UNION
    SELECT UT.TABLE_NAME FROM
    SELECT TABLE_NAME FROM USER_TABLES
    MINUS
    SELECT DISTINCT UPPER(REFERENCED_NAME)
    FROM user_dependencies
    where
    referenced_type='TABLE' and UPPER(NAME) in
    select distinct UPPER(object_name) from user_objects where UPPER(object_type) in
    'MATERIALIZED VIEW',
    'PACKAGE',
    'PACKAGE BODY',
    'PROCEDURE',
    'TRIGGER',
    'VIEW',
    'FUNCTION'
    AND REFERENCED_OWNER=(SELECT sys_context('USERENV', 'CURRENT_SCHEMA') FROM dual)
    ) UT,
    ( SELECT * FROM USER_SOURCE
    WHERE NAME IN
    ( SELECT DISTINCT NAME FROM USER_SOURCE
    WHERE TYPE NOT IN ('TYPE')
    AND
    UPPER(TEXT) LIKE '%EXECUTE IMMEDIATE%'
    ) US
    WHERE
    UPPER(US.TEXT) LIKE '%'||UPPER(UT.TABLE_NAME)||'%'
    AND
    (UPPER(US.TEXT) NOT LIKE '%--%')
    The above SQL Query can list out unused tables by checking the Dynamic SQL Statement also upto some level only.
    Once we extracted the list of unused tables, having a manual check would be also greater to verify as it is should not impact the business applications.
    Regards,
    Subramanian G

  • Unable to  use Table name in a variable

    Hi,
    I am trying to build a select statement which uses table name in a variable. Please help me in building such statements.
    Regards
    Kishore

    Hi,
    I am trying to build a select statement which uses table name in a variable. Please help me in building such statements.
    Regards
    Kishore

  • Problem in using table name dynamically in PL/SQL

    I tried to create a procedure to use table name dynamically and got the following error. Anything wrong with my procedure?
    NFADV>declare
      2   cnt number;
      3   cursor cur is select table_name from user_tables where table_name in ('EMP','DEPT');
      4  begin
      5   for c1 in cur
      6   loop
      7    execute immediate select count(*) into cnt from c1.table_name;
      8      dbms_output.put_line('Count is : '||cnt);
      9   end loop;
    10  end;
    11  /
    declare
    ERROR at line 1:
    ORA-06550: line 7, column 21:
    PLS-00103: Encountered the symbol "SELECT" when expecting one of the following:
    ( - + case mod new not null <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> avg
    count current exists max min prior sql stddev sum variance
    execute forall merge time timestamp interval date
    <a string literal with character set specification>
    <a number> <a single-quoted SQL string> pipe
    <an alternatively-quoted string literal with character set specification>
    <an alternatively-quo
    ORA-06550: line 8, column 5:
    PLS-00103: Encountered the symbol "DBMS_OUTPUT"
    ORA-06550: line 8, column 45:
    PLS-00103: Encountered the symbol ";" when expecting one of the following:
    . ( , * % & - + / at mod remainder rem <an identifier>
    <a double-quoted delimited-identifier> <an exponent (**)> as
    from into || multiset bulkThanks and Regards
    Kaustubh

    Hi,
    The wrong part is in execute immediate, it should be as follows:
    execute immediate ('select count(*) from '|| c1.table_name)
    into cnt
    (not tested)
    Regards
    AK

  • How to use table name dynamically in report  procedure

    Hello every body
    I want to use table name dynamically means at runtime i want to pass table name.
    I can do this by lexical parameter in main query.
    But my problem is that i want to crate new format trigger or new function that use 1 cursor in which that lexical parameter : table name is used.
    so how to do that?
    i can not use that lexical parameter it is giving error.
    please help me how to do that.

    Call a database function which you pass the lexical parameter. Then in the database function you use dynamic sql or the execute immediate option to build the SQL string.
    Return the information from this function to build your business logic on in your format trigger.
    Marcos

  • Using TCOde rscrm_bapi and a query result in a error

    Hi All,
    When using tcode RSCRM_BAPI the query execution results in a error Query Meta data is Incomplete
    Please suggest me the solution for this ASAP.
    Regards,
    Varma

    Hi Varma,
    is the query working fine?? Otherwise use transaction RSRT2 and "generate a new report"! This should fix problems with query.
    Regards,
    Adem

  • Can substitution strings be used for table name references?

    Hi,
    I was wondering if it's possible to use substituion strings for table names in SQL queries. This would allow for me to edit all references to a table at one location. For instance, if a table name or dblink changed, I could edit the substitution string or application item to ensure all the queries reference the new table.
    For example:
    select * from &table1.
    table1 would be the substitution string for the actual table name
    I know this is possible if I used a pl/sql function returning a query, but I would much rather use a substition string in a SQL query.
    Thanks in advance.
    Brian

    i think not
    because how create the fields of * in this case
    in the other because all is dynamic, i think that you obtain only an error

  • Use Table Name in Summary Table

    Hi,
    I am looking for a way to use the names of tables in another table.
    eq. I have tables named after the months. And I want to use this name in another table in which i summarize all the facts from the mont tables. Is there a way to refer to the table name?
    Thanks in Advance Paul

    Hi Jerrold
    It seems that we made the same interpretation.
    I just wished to give a soluce allowing the user to change easily the name of the referenced table.
    In my sample, if I add a new table, the required task is just to add it's name in the first column and replicate the original formula with no change.
    For a single formula, it changes quite nothing but if we use many cells, it's an efficient time saving.
    I just gave a really bare example.
    Here is one with more referenced cells.
    Don't worry, the separator is semi-colon because I ran Numbers in English on my French system
    Yvan KOENIG (VALLAURIS, France.) mardi 11 août 2009 17:19:46

  • Using Table name in Read statement dynamically

    Hi Experts,
    I have the following requirement.
    Based on a country code say "A" , "B", "C" and based on this i have to read different internal tables lt_tabA, lt_tabB and lt_tabC.
    The table key can be given dynamically, but how can i use the internal table name dynamically without using if statements.
    Please help.
    Thanks!
    Best Regards,
    Gayathri

    Hi Gayathri,
    something like
    DATA:
        lt_t100 TYPE TABLE OF t100,
        lt_t000 TYPE TABLE OF t000.
      FIELD-SYMBOLS:
        <table> TYPE table,
        <rec>   TYPE ANY,
        <field> TYPE ANY.
      SELECT:
        * INTO CORRESPONDING FIELDS OF TABLE lt_t100 FROM t100 UP TO 10 ROWS,
        * INTO CORRESPONDING FIELDS OF TABLE lt_t000 FROM t000 UP TO 10 ROWS.
      CASE abap_true.
        WHEN space.
          ASSIGN  lt_t100 TO <table>.
        WHEN OTHERS.
          ASSIGN  lt_t000 TO <table>.
      ENDCASE.
      READ TABLE <table> with key ('MANDT') = sy-mandt ASSIGNING <rec>.
    Regards,
    Clemens

  • Use table name in UPDATE statement as variable

    Hi All,
    I am using ORACLE 9i AIX base. I want to write following procedure:
    PROCEDURE update_header (
    p_care_msg_nbr IN NUMBER,
    p_care_msg_id IN NUMBER,
    p_care_msg_gkey IN NUMBER,
    p_old_status IN VARCHAR2,
    p_new_status IN VARCHAR2
    IS
    l_table varchar2(50);
    BEGIN
    l_table := 'CARE_EDI_MESSAGES';
    UPDATE '&l_table'
    SET status = p_new_status,
    changed = sysdate,
    changer = user
    WHERE care_msg_no = p_care_msg_nbr
    AND care_msg_id = p_care_msg_id
    AND gkey = p_care_msg_gkey
    AND status = p_old_status;
    END;
    I want to give the table name by passing value in a variable or parameter. Is it the write way or can I do this function in any other way.
    Pleae tell me in urgency.
    Thanks & Regards
    Hassan Raza

    This implies that you have several tables with identical or near identical structures, otherwise you will get errors if any of the mentioned columns do not exist in the table passed but ...
    You cannot use a substitution variable that way. Oracle will ask for a value when you try to create the procedure, and compile what ever value you supply into the procedure viz.
    SQL> CREATE PROCEDURE p AS
      2  l_id NUMBER;
      3  BEGIN
      4     SELECT id INTO l_id FROM &t;
      5  END;
      6  /
    Enter value for t: T
    old   4:    SELECT id INTO l_id FROM &t;
    new   4:    SELECT id INTO l_id FROM T;
    Procedure created.
    SQL> SELECT text FROM user_source WHERE name = 'P'
      2  ORDER BY line;
    TEXT
    PROCEDURE p AS
    l_id NUMBER;
    BEGIN
       SELECT id INTO l_id FROM T;
    END;Even if that is the effect you want, note that there are no quotes around the substitution variable in the CREATE statement.
    If you want to be able to pass the name of the table to the procedure, then you need to make the table name a parameter, then build the sql statement and execute it using EXECUTE IMMEDIATE. Something more like:
    PROCEDURE update_header (p_care_msg_nbr  IN NUMBER,
                             p_care_msg_id   IN NUMBER,
                             p_care_msg_gkey IN NUMBER,
                             p_old_status    IN VARCHAR2,
                             p_new_status    IN VARCHAR2,
                             p_table         IN VARCHAR2) IS
    l_sqlstr VARCHAR2(4000);
    BEGIN
       l_sqlstr := 'UPDATE '||p_table||' SET status = :b1 '||
                   'changed = sysdate, changer = user '||
                   'WHERE care_msg_no = :b1 and care_msg_id = :b3 and '||
                   'gkey = :b4 and status = :b5';
       EXECUTE IMMEDIATE l_sqlstr
          USING p_new_status, p_care_msg_nbr, p_care_msg_id, p_care_msg_gkey, p_old_status;
    END;HTH
    John

  • ODI: Using Table Name in Dynamic filters

    We have a requirement, where the filters have to be dynamically generated and applied on the source system data stores.
    The requirement can be best explained by the below example.
    I have EMPLOYEE and DEPARTMENT table as the source datastores and EMP_DEPT (flat table) as the target datastore.
    The filter condition will be updated now and then by the admin in a table. They would like to run the integration interface with the condition mentioned in the table.
    Metadata table and sample data: (DY_FILTERS)
    TABLE_NAME | INTERFACE_NAME | CONDITION
    EMPLOYEE | EMP_DEPT | EMPLOYEE.EMPLOYEE_NAME LIKE 'A%'
    DEPARTMENT | EMP_DEPT | DEPARTMENT.DEPARTMENT_ID = 10
    So now the interface has to run with the conditions 'EMPLOYEE.EMPLOYEE_NAME LIKE 'A%' and DEPARTMENT.DEPARTMENT_ID = 10.
    To achieve, the best possible solution I can think of is, I have defined a variable for the dynamic filter and under the refresh section and I am planning to use the following query:
    SELECT CONDITION FROM DY_FILTERS WHERE INTERFACE_NAME = <%=odiRef.getPop("POP_NAME")%> AND
    TABLE_NAME = ***************.
    I was able to pick the interface that is currently involved by using getPop() method where as I dont have clue for getting the table name.
    Please share with me, if you have answer. Also if you have any other way to achieve this, please share the same.
    Note: The actual scenario is more complex than the example given above. But the crux of the requirement is very well covered in the example.
    Edited by: 986046 on Feb 14, 2013 2:06 PM

    Hi,
    If you've only one source datastore in your interface, you can retrieve it's name with <%=odiRef.getSrcTablesList("[RES_NAME]", "")%>.
    If you have more than one source it will list all you sources.
    However I can't see when you plan to refresh your variable. getSrcTablesList won't work before/after the interface execution.
    Regards,
    JeromeFr

  • To know schema using table name

    Can I know the schema using the table name.

    I have a handy if probably overcomplicated script for this:
    SQL> @which v$session
    Objects matching 'v$session':
    Name                                       Type                OWNER                Granted? Synonym
    V$SESSION                                  SYNONYM             PUBLIC
    SYS.V_$SESSION (VIEW)
    SQL> @which dual
    Objects matching 'dual':
    Name                                       Type                OWNER                Granted? Synonym
    DUAL                                       SYNONYM             PUBLIC
                                               TABLE               SYS                  Yes      DUAL
    SYS.DUAL (TABLE)
    www.williamrobertson.net/scripts/which.sql

  • How to Use Table name at run time

    Hi All
    I have created a function that accepts a table name as a parameter and returns the maximam sequence number, but in my function body i can not write the parameter name as a table i.e.
    CREATE OR REPLACE FUNCTION MAX_ID(TAB_NAME Varchar)
    RETURN Number IS
    max_id Number;
    CURSOR curSalPoint IS
         SELECT MAX(EMP_NUMBER)
         FROM TAB_NAME ;
    BEGIN
    max_id:=0;
    OPEN curSalPoint ;
         FETCH curSalPoint INTO max_id;
         CLOSE curSalPoint;
    RETURN max_id
    END
    But it will give an error saying
    (1):PL/SQL: ORA-00942: table or view does not exist
    for "TAB_NAME"
    Any help would be appreciate ........

    Yes, as i contcatinated table name with the original statement, so you can also continate fields' names with your statment and execute immediate the statement.
    Sorry i forgot this statement in my function, to execute the statement you need to include following statement
    CREATE OR REPLACE FUNCTION MAX_ID(TAB_NAME Varchar)
    RETURN Number IS
    max_id Number;
    query varchar2(200);
    BEGIN
    max_id:=0;
    query:=null;
    query := query || 'select max(empno) into max_id from'|| tab_name;
    EXECUTE IMMEDIATE query;
    RETURN max_id;
    END;
    Message was edited by:
    Salman Qureshi

  • How to use table name as variable in insert statement

    Hi,
    I want to insert data from the cursor into the table and I want to submit table name as a variable. I tried the code below but it's not working. Any ideas how to solve this problem? Thx
    DECLARE
    v_new_table_name VARCHAR2(30) := 'test';
    --open cursor   
    CURSOR ACM IS
    SELECT *
    FROM DWH.CLI_DIMENSION@SLSPDW CLI
    WHERE where_clause
    FROM some_table;
    BEGIN
    FOR REC_ACM IN ACM LOOP
    EXECUTE IMMEDIATE 'INSERT INTO ' || v_new_table_name || ' VALUES REC_ACM'; --table name as a variable in which the data from cursor will be inserted
    V_ROWCOUNT := V_ROWCOUNT + 1;
    IF MOD(V_ROWCOUNT, 100) = 0 THEN --this feature commits after 100 rows.
    COMMIT;
    END IF;
    END LOOP;
    COMMIT;
    DBMS_OUTPUT.PUT_LINE('Number of inserted records:' || V_ROWCOUNT);
    END;

    Try this and let me know if it works. I have not tested it so I can not say for sure.
    DECLARE
      v_new_table_name VARCHAR2(30) := 'test';
      CURSOR ACM IS
        SELECT * FROM DWH.CLI_DIMENSION@SLSPDW CLI
                WHERE where_clause
                FROM some_table;
      BEGIN
      loop
       fetch ACM INTO REC_ACM
       exit when ACM%NOTFOUND;
       EXECUTE IMMEDIATE 'INSERT INTO ' || v_new_table_name || ' VALUES REC_ACM';
       V_ROWCOUNT := V_ROWCOUNT + 1;
       IF MOD(V_ROWCOUNT, 100) = 0 THEN
        COMMIT;
       END IF;
      end loop;
      COMMIT;
      DBMS_OUTPUT.PUT_LINE('Number of inserted records:' || V_ROWCOUNT);
      END;

  • Table Names for the Contract Budget(PO value) and Invoiced Budget

    Hello Team,
    Can you please share your ides on the below two queries
    1. How can we Identify the Contract Budget from the P.O Number
    2. How can we know how much of it has been Invoiced
    Please provide the Table Names also if you know, where these values can be stored.
    These are required to create a BW report.
    Regards,
    gsnreddy.

    Hi Aleksey Tkachenko
    Thanks for the reply
    let me clear this a little bit about my query
    what i want is the total PO value
    i.e. for how much amount the PO was created and how much of that amount is converted in to invoice
    Where can i get this data?
    Is this data was saved in any of the SAP table?
    Regards,

Maybe you are looking for