+ Reply to Thread
Results 1 to 18 of 18

Template Spreadsheet and Formula

  1. #1
    Registered User
    Join Date
    09-26-2019
    Location
    Oklahoma
    MS-Off Ver
    2016
    Posts
    9

    Template Spreadsheet and Formula

    Hello,

    New member here that's pulling his hair out trying to figure this out!!

    I have a formatted spreadsheet that I'm using as a template. Included in this spreadsheet is a formula in cell A2 (=SUMPRODUCT(G5:G400,J5:J400)). I'm importing data into this spreadsheet from a SQL database using an SSIS package with the data beginning in cell A5

    Everything works perfectly EXCEPT the dang formula will not calculate until I open the formula in the formula bar and press Enter.
    Now, before everyone tells me to check the Calculation Options and check "Automatic", it already is. I've also ensured that the data in columns G5-G400 and J5-J400 is formatted as numbers, although it doesn't appear to make any difference if the format is number or general.

    Can anyone save my sanity!!!


    Chuck
    Last edited by Chas617; 09-26-2019 at 12:27 PM. Reason: spelling

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Template Spreadsheet and Fomula

    Are the contents FORMATTED as numbers or REAL numbers?
    If left aligned ( without manual alignment) they are text

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Template Spreadsheet and Fomula

    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  4. #4
    Registered User
    Join Date
    09-26-2019
    Location
    Oklahoma
    MS-Off Ver
    2016
    Posts
    9

    Re: Template Spreadsheet and Fomula

    Pepe,

    The data in the columns show right justified so they "should" be resolving as numbers.
    I can't attach a before spreadsheet because each time I copy it to a new workbook,
    the formula updates correctly. And no, there is no macro or VB code embedded.
    I also can't attach anything until I have more posts.

  5. #5
    Registered User
    Join Date
    09-26-2019
    Location
    Oklahoma
    MS-Off Ver
    2016
    Posts
    9

    Re: Template Spreadsheet and Fomula

    trying again.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    09-26-2019
    Location
    Oklahoma
    MS-Off Ver
    2016
    Posts
    9

    Re: Template Spreadsheet and Fomula

    If it helps, I attached the template spreadsheet I'm using
    Attached Files Attached Files

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Template Spreadsheet and Formula

    There is no restriction on posting attachments... only links (a partly-effective anti-spam measure). So. I opened the sample... it's fine. I open the template and paste some stuff in.... and it's fine, too.. Really odd....
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  8. #8
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Template Spreadsheet and Fomula

    Hi Chas,

    Maybe not what your want to hear, but the formula in B1 calculates fine for me when I entered some data in G5:G400 and J5:J400

    I'm importing data into this spreadsheet from a SQL database using an SSIS package with the data beginning in cell A5
    The spreadsheet you posted didn't have any data in it so hard to see what you are actually getting from the SQL database pull.

    Just for further testing, use =ISNUMBER(G5) just to make sure these values are really numbers.
    HTH
    Regards, Jeff

  9. #9
    Registered User
    Join Date
    09-26-2019
    Location
    Oklahoma
    MS-Off Ver
    2016
    Posts
    9

    Re: Template Spreadsheet and Formula

    The =ISNUMBER(G5) returns TRUE.

    Glenn: Yes, really odd. I can also copy data from the spreadsheet that's not calculating into the template spreadsheet and it calculates perfectly.
    It seems that only when I load the data from the SSIS package to the template spreadsheet that it fails to calculate.

    In the database, the data in Column G is defined as integer and the data in column J is defined as real.
    I've had to run a data conversion in the SSIS package as the data type required in the template spreadsheet
    for column G is a four byte signed interger and the data type required for column J is double-precision float.
    Could this be the start of my problem?

    Also, I'm very confused by trying to match the database data types and the formatted spreadsheet.

  10. #10
    Registered User
    Join Date
    09-26-2019
    Location
    Oklahoma
    MS-Off Ver
    2016
    Posts
    9

    Re: Template Spreadsheet and Formula

    Jeff: Refer to post # 5 where the Post.xlsx attachment is. The data is live data.

  11. #11
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Template Spreadsheet and Formula

    Hi Chas,

    Yes, I had previously looked at that attachment is it calculates for me just fine. This is indeed odd. I'm not all that familiar with the SSIS package and its data extract, but sounds reasonable.

    Again, the only thing I can suggest, if after the data is extracted from the SSIS package, if the data is a number it should calculate. Have you tried to run the formula thru the evaluate?

    Evaluate Formula
    • Click on the cell with the formula >> Ribbon >> Formulas >> Formula Auditing >> Evaluate Formula

  12. #12
    Registered User
    Join Date
    09-26-2019
    Location
    Oklahoma
    MS-Off Ver
    2016
    Posts
    9

    Re: Template Spreadsheet and Formula

    When it doesn't calculate (remains zero) I have used the Evaluate Formula function. Returns zero.
    Attached Images Attached Images

  13. #13
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Template Spreadsheet and Formula

    What if you put in N5 and copied down >> =G5*J5.

    Does that calculate?

  14. #14
    Registered User
    Join Date
    09-26-2019
    Location
    Oklahoma
    MS-Off Ver
    2016
    Posts
    9

    Re: Template Spreadsheet and Formula

    The live data I'm working with has G5 as zero. I use G6 and J6. Worked normally.

  15. #15
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Template Spreadsheet and Formula

    Unfortunately, I am out of suggestions, but I have placed a call in to the other "Guru's"

  16. #16
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,885

    Re: Template Spreadsheet and Formula

    My guess, SSIS package is treating 1st row as header.
    Even if 0 is stored as text in Excel. If you use =ISNUMBER(Cell) it will evaluate as being true.

    When data is copied, Excel treats what looks like number as double type and will evaluate correctly.

    Take a look in how SSIS package is set up and see if you can address it (or use TextToColumn operation on imported data).

    Another alternative is to use Get & Transform to import data from SQL. You will have more fine control over data type and how queries are executed (though this will return data as table with header(s), which may not be desired in this case).
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  17. #17
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,885

    Re: Template Spreadsheet and Formula

    Oh, just had an idea...

    What happens if you change formula to below? This should coerce text that's like number to number.
    =SUMPRODUCT((G5:G400)*(J5:J400))

  18. #18
    Registered User
    Join Date
    09-26-2019
    Location
    Oklahoma
    MS-Off Ver
    2016
    Posts
    9

    Re: Template Spreadsheet and Formula

    Tried that too. Didn't work. I began thinking that I was having issues with data types. I resorted to changing my SSIS package and used the SSIS Import and Export Wizard. It showed some interesting data conversions but the data in my spreadsheet was good and my formula calculated!
    Now I have a different problem. The resulting workbook has 2 sheets grouped. In order to mark up the needed spreadsheet (check boxes) I have to ungroup manually. Can I avoid this automatically?

+ 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. Replies: 2
    Last Post: 03-08-2017, 05:29 AM
  2. Replies: 7
    Last Post: 12-01-2016, 06:23 PM
  3. Replies: 0
    Last Post: 02-28-2012, 11:40 AM
  4. Using spreadsheet as template
    By Jakes in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-26-2012, 11:44 AM
  5. saving spreadsheet as a template
    By dwarford101 in forum Excel General
    Replies: 1
    Last Post: 08-17-2009, 12:32 PM
  6. Copying fomula (from another spreadsheet) down
    By Chris424 in forum Excel General
    Replies: 7
    Last Post: 06-25-2008, 07:00 AM
  7. Fomula Advice needed for a fuel spreadsheet,
    By Majestic in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 04-04-2007, 10:19 AM

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