Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all 89424 articles
Browse latest View live

Get Range of Groups of Cells Excel C++/cli

$
0
0

I have a Excel spreadsheet that I want to extract data from using .Net framework. The Worksheet looks like this in a way:

      A     B    C    D    E    F    G1  |hello| by | it |____|____| it | is |2  | Hi  | he | To |____|____|you | are|

How would I get two separate ranges to pull the two"tables" into two different data tables?

I understand there is

Excel::Range^ RANGE = Worksheet->Cells;

But for one I do not understand how to utilize Range. And two, after reading it apparently returns the whole range of the worksheet and does not separate the two "tables".

Does anyone know how I could get the ranges "A1:C2" and F1:G2"?


How to stop VBA error when no data to copy

$
0
0

I have a VBA macro which filters data and copies the results to another sheet. Everything was fine when the football seasons around the world were in full swing, but now with many having completed their interrupted seasons, there is less data. What happens is when there is NO data to transfer, I get an runtime error 1004 message "No cells were found". There are a number of these macros which are called in order, so when this stops, it causes the others to not proceed.

Here is the code

   Dim arr, ws As Worksheet, lc As Long, lr As Long    arr = Array("S.EPL-DE-AUT-Home-Win", "S.Gre_HomeWin", "S.Ger_EPL_NL_Pol_SPL_HomeWin", _"S.DE_EPL_LALiga_Big_Odds_Jolly")    Set ws = ActiveSheet'range from A1 to last column header and last row    lc = ws.Cells(1, ws.Columns.Count).End(xlToLeft).Column    lr = ws.Cells.Find("*", after:=ws.Range("A1"), LookAt:=xlPart, _                        SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row    With ws.Range("A1", ws.Cells(lr, lc))        .HorizontalAlignment = xlCenter        .AutoFilter Field:=1, Criteria1:=arr, Operator:=xlFilterValues        .Offset(1, 0).Resize(.Rows.Count - 1).SpecialCells(xlCellTypeVisible).Copy    End With    Workbooks("Predictology-Reports.xlsx").Sheets("Football Profits") _          .Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial xlPasteValues    Application.CutCopyMode = FalseEnd Sub

Is there a way to have it ignore no cells to copy? I can then make the same amendment in all the other ones.

cheers in advance

"Automation Error: Object Invoked has disconnected from its clients"

$
0
0

I figured out what Nick was suggesting, and the following is the error number & description that I'm getting:

'-2147417848 (80010108)' Automation error The object invoked hasdisconnected from its clients

The line of code that is highlighted when I debug is:

.Rows(Lst).Insert Shift:=xlDown

I thought that I had seen somewhere on this or another forum to unregister then re-register a specific file, but I was at home when I came across that, and didn't want to try it on my laptop, since everything already works 100% on it.

Once again, any help is greatly appreciated. I leave Sunday for 2 weeks, and I really need to get this working before I leave. Most of the people working for me are not excel guru's and need all buttons/functions working, as they won't be able to troubleshoot and/or work around the problems.

I am still sitting with the following code in a regular module, and the next set of code below that is in one of the worksheet modules.

 Sub add_InvRow() Application.Calculation = xlCalculationManual Application.EnableEvents = False switch = "off" With ThisWorkbook  Dim wb As Excel.Workbook, Lst As Long  Set wb = Application.ThisWorkbookDim ws As Worksheet, sw As Worksheet, os As Worksheet   Set ws = ActiveSheet: Set sw = Application.Sheets(Sheet1.Name): Set os = Application.Sheets(Sheet4.Name)  With ws  Lst = ActiveCell.Row  End With   If ws.CodeName = "Sheet3" Then  With os   .Rows(213).Copy  End With  With ws   .Rows(Lst).Insert Shift:=xlDown   Application.CutCopyMode = False    venTabForm.Show  End WithEnd IfIf ws.CodeName = "Sheet23" Then  With sw   .Rows(135).Copy  End With  With ws   .Rows(Lst).Insert Shift:=xlDown   Application.CutCopyMode = False    cItemForm.Show  End WithEnd If If ws.CodeName = "Sheet25" Then With sw   .Rows(105).Copy  End With  With ws   .Rows(Lst).Insert Shift:=xlDown   Application.CutCopyMode = False   coInvForm.Show  End With End If If ws.CodeName = "Sheet28" Then  With sw   .Rows(100).Copy  End With  With ws   .Rows(Lst).Insert Shift:=xlDown   Application.CutCopyMode = False   kInvForm.Show  End WithEnd IfIf ws.CodeName = "Sheet27" Then  With sw   .Rows(130).Copy  End With  With ws     .Rows(Lst).Insert Shift:=xlDown     Application.CutCopyMode = False     ItemForm.Show  End WithEnd IfIf ws.CodeName = "Sheet22" Then  With sw   .Rows(120).Copy  End With  With ws   .Rows(Lst).Insert Shift:=xlDown   Application.CutCopyMode = False    caInvForm.Show  End WithEnd If Set ws = Nothing: Set sw = Nothing: Set os = Nothing: Set wb = NothingEnd With switch = "on" Application.EnableEvents = True Application.Calculation = xlCalculationAutomaticEnd Sub

This code is on one of the worksheets that has a command button, which calls the above code.

 Private Sub Worksheet_Change(ByVal Target As Range)If Target.Cells.Count > 1 Then Exit SubIf switch = "off" Then Exit Sub If Target.Address = "$H$1" Then  Call findItem Exit Sub End IfIf Application.Intersect(Target, Me.Range("P:P")) Is Nothing Or Target.Cells.Count > 1 Then Exit SubIf Target.Cells.Value = 0 Or Target.Cells.Value = "" Then Exit SubDim wb As Workbook, ws As Worksheet, iNUM As String, kitSHT As Worksheet, ksRNG As Range, kITEM As Range, kbCELL As RangeDim iNAME As String, catSHT As Worksheet, csRNG As Range, cbCELL As Range, cITEM As RangeDim logCELL As RangeSet wb = ThisWorkbook: Set ws = wb.Sheets(Sheet27.Name): Set kitSHT = wb.Sheets(Sheet28.Name): Set catSHT = wb.Sheets(Sheet22.Name)Set ksRNG = kitSHT.Range("C5:C1100"): Set kbCELL = ksRNG.Cells(5, 3)Set csRNG = catSHT.Range("C6:C400"): Set cbCELL = csRNG.Cells(6, 3) If (Not (Application.Intersect(Target, Me.Range("A:P")) Is Nothing)) And (Target.Cells.Count = 1) And (Target.Column = 16) Then  If Target.Value = 0 Then Exit Sub   iNUM = Target.Offset(, -12).Value   iNAME = Target.Offset(, -10).Value   If kitSHT.Cells.Find(What:=iNUM, After:=kbCELL, LookIn:=xlValues, LookAt:= _xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False) Is Nothing And _  catSHT.Cells.Find(What:=iNUM, After:=cbCELL, LookIn:=xlValues, LookAt:= _xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False) Is Nothing Then    MsgBox iNUM & "-" & iNAME & "" & " is not currently listed on" & " " & kitSHT.Name & " " & "or" & " " & catSHT.Name & vbNewLine & vbNewLine & _"Please add" & " " & iNUM & "-" & iNAME & "" & " to" & " " & kitSHT.Name & " " & _"or" & " " & catSHT.Name & " " & "and corresponding count sheets", vbInformation  Set wb = Nothing: Set ws = Nothing: Set kbCELL = Nothing  Set ksRNG = Nothing: Set kitSHT = Nothing: Set cbCELL = Nothing: Set catSHT = Nothing: Set csRNG = Nothing  Exit Sub ElseIf Target.Value = 0 Then Exit Sub  premNUM = iNUM pFORM.Show End If End If  Set wb = Nothing: Set ws = Nothing: Set kbCELL = Nothing  Set ksRNG = Nothing: Set kitSHT = Nothing: Set cbCELL = Nothing: Set catSHT = Nothing: Set csRNG = Nothing  Set ksRNG = Nothing: Set kitSHT = Nothing: Set cbCELL = Nothing: Set catSHT = Nothing: Set csRNG = NothingEnd Sub

Migrating from Excel Services in Sharepoint 2013 to Sraepoint in Office 365

$
0
0

Our company has numerous excel reports stored in Sharepoint 2013. A web app injects data into these reports when a user runs them, and uses Sharepoint Excel Services as the excel engine to calculate the workbooks, and then sucks the files out of sharepoin t and streams to the browser. Now, were are moving to Office 365, so I fear 'tis the end of such functionalty. Does anyone know of a migration path from Excel Services to Sharepoint in office 365? I have not been able to find any blog posts or microsoft communications which address this.

Thanks

Is any cell is selected in excel sheet [closed]

$
0
0

I have created an data entry sheet with userform without any list box. I have now 2 command button "submit" & "reset".

I want to add another command button "Edit" and "Delete".

For which I need a program code.

My idea is:

When i select a particular cell in the database sheet, and when i open the userform, all the values in that row of active cell should be loaded in the userform, then I have the code for edit command button to edit the values.

I want to change the below code to select direct from sheet values and not form listbox as i have not configured list box.

 Private Sub Button_Submit_Click()    If Not IsAnythingSelected(ListBox1) Then        MsgBox "Please select your name"    End IfEnd SubFunction IsAnythingSelected(lBox As Control) As Boolean    Dim i As Long    Dim selected As Boolean    selected = False    For i = 1 To lBox.ListCount        If lBox.selected(i) Then            selected = True            Exit For        End If    Next i    IsAnythingSelected = selectedEnd Function

SSIS: CSV extracts opened in excel - some string values shown as date

$
0
0

I have a SSIS package that generates csv extracts.
there is column in the extract say Col1 which have values in the format integer/integer or just integer
e.g.
22
5/27
9/114

The flat file connection datatype of Col1 is String[DT_STR] width 100. col1 is loaded from SQL DB table column of datatype varchar(100).
The extracts are generated fine and everything looks ok when the extracts are opened in text editor.
But the client who receives the extracts opens it in excel and complains that some values are shown as date.
e.g. above values are shown as
22
May-27
9/114

I know about the existing issues when csv opened with excel.
Is there any option in ssis that can force the column shows the values as string even when opened in excel?
or any other possible solution for this issue can anyone please suggest.

Thanks!

Excel Filters - show only relevant values in the filter

$
0
0

Lets say i have two filters in an excel pivot table.

Both would initially display all values in the selected range for the filter column.

When i select a couple of values only in filter 1, the filter 2 still continues to display all values in that's particular filter's column in the selected range in base data.

What i want to do is when a certain value is selected in one filter, the second filter automatically reloads to show only values relevant to the values selected in filter 1.

Any help or workaround would be appreciated.

Thanks

To Get only one raw of result for a particular Range

$
0
0

Following code is suggested by a helpful user, this works well to Calculate "From", "To", "MAX" etc values of a range. But this code gives results in every row of a range. I want to get the results in only first row of each row. Please help with this.

 Sub trial()Dim lastrow As LongDim destSht As WorksheetDim i As Long, j As LongSet destSht = Worksheets("Final")With Worksheets("Source")lastrow = .Range("B" & .Rows.Count).End(xlUp).RowFor i = 2 To lastrow + 1 'loop whole range (column C)    If .Cells(i, "C") <> "" Then 'If column C is not empty then        For j = i To lastrow + 1 'Loop "group" range to find next empty cell. Start from current loop i to last row and add one row to get to next empty cell.            If .Cells(j, "C") = "" Then 'When next empty cell is found (i.e. end of small group range) then apply formulas                .Cells(i, "E").Value = .Cells(i, "B").Value 'From                .Cells(i, "F").Value = .Cells(j - 1, "B").Value 'To                .Cells(i, "G").Formula = "=MAX(C" & i & ":C" & j - 1 & ")" 'MAX                .Cells(i, "H").Formula = "=MIN(C" & i & ":C" & j - 1 & ")" 'MIN                .Cells(i, "I").Formula = "=AVERAGE(C" & i & ":C" & j - 1 & ")" 'AVG                Exit For            End If        Next j    End IfNext IEnd WithEnd Sub

This Code gives following resultResult by Above Code

Desired ResultDesired Result Image


Delete all the cells that contain "%"

$
0
0

but they gave me a file with 52 sheets

Sub delete_percentage()Dim CELL As RangeDim AREA As RangeDim SHEET As WorksheetSet AREA = Range("A1:W100")On Error Resume NextFor Each SHEET In ActiveWorkbook.WorksheetsOn Error GoTo FINISHFor Each CELL In AREARange("A1:W100").Find("%").SelectSelection.Delete (xlToLeft)Next CELLFINISH:Next SHEETEnd Sub

For Loops to perform a Step of 3 only after inserting a value into 6 rows of cells

$
0
0

The following code I have Will paste a value code of "01" to a cell and then skip 4 rows continuously, until reaching the end of count within the for loop. I want to run a similar loop for "02", but rather than "Step" (skip) 4 rows, I would like it to insert the value in 6 consecutive rows within the same column and then skip 3 rows continuously until reaching the end of count. I am 2 weeks new to vba, so I hope I am explaining this correctly.

Dim i As LongIf Sheet3.Range("C22").Value = "01" Then    For i = 3 To 202 Step 4        ActiveWorkbook.Sheets("CrewEntries").Cells(i, 6).Value = _                  ActiveWorkbook.Sheets("MonData").Cells(22, 5).Value    Next iElseIf Sheet3.Range("C22").Value = "02" Then    For i = 3 To 152        ActiveWorkbook.Sheets("CrewEntries").Cells(i, 6).Value = _                  ActiveWorkbook.Sheets("MonData").Cells(22, 5).Value    Next iEnd If

Wrong number of argument or invalid property assignment collection adding

$
0
0

I've been getting a

wrong number of argument or invalid property assignment collection

error for a long time now, but can't figure out what's wrong. I have a class and a Collection inside that class and a Sub to add values to that collection.

Private sumLosses As CollectionPrivate Sub Class_Initialize()     Set sumLosses = New CollectionEnd SubPublic Property Get getSumLosses()    getSumLosses = sumLossesEnd Property

Inside main module:

For Each clientCopy In clientsColl        clientCopy.getSumLosses.Add 200  'error        clientCopy.getSumLosses.Add (200) 'errorNext

Why does this fail and how do I add the items to a class' collection?

Follow up on UDF for Google first result

Excel Convert Date from 4xxxx to the yyyy-mm-dd format using Python and Pandas

$
0
0

Update 06/08:

Tried it without the quotations for another column:

def read_date(DOB):return xlrd.xldate.xldate_as_datetime(DOB,0)

df_custlist[DOB] = pd.to_datetime(df_custlist[DOB].apply(read_date), format = '%Y%m%d', errors = 'coerce')

print(df_custlist)

i am getting this error. the name of the column DOB

NameError: name 'DOB' is not defined -

---- 04/08:-----

I have an existing data frame df_transactions. I want to convert the date from an entire excel column This is my code:

def read_date('product_first_sold_date'):    return xlrd.xldate.xldate_as_datetime(product_first_sold_date,0)df_transactions['product_first_sold_date'] = pd.to_datetime(df_transactions['product_first_sold_date'].apply(read_date), format = '%Y%m%d', errors = 'coerce')print(df_transactions)

I am getting this error:

File "<ipython-input-89-06ed565a4dbc>", line 1    def read_date('product_first_sold_date'):SyntaxError: invalid syntax

EXCEL VBA - Need to filter, and then autofill a value from the second row down to the lowest row

$
0
0

I am trying to autofill the rest of the rows down to the lowest row with values in it. Looking at other posts and my own research and testing I created a code. However, my code has a filter and these filter values change over time. As you can see in the code, I am selecting AB2 and inserting Yes, and then autofilling to the bottom, or to lowest value in column Z. However sometimes due to the filters No and Yes, the second row might be AB3 or even AB4. Is there a way I am able to automate this function, where I can place the value Yes under the first row and then autofill it down without having to change the number next to AB every time.

Columns("F:H").SelectSelection.AutoFilterActiveSheet.Range("$F$1:$H$13889").AutoFilter Field:=1, Criteria1:="No"ActiveSheet.Range("$F$1:$H$13889").AutoFilter Field:=3, Criteria1:="Yes"Range("AB2").SelectActiveCell.FormulaR1C1 = "Yes"Selection.AutoFill Destination:=Range("AB2:AB" & Range("Z" & Rows.Count).End(xlUp).Row)Range(Selection, Selection.End(xlDown)).Select

Excel VBA macro to save excel workbook to pdf will not save

$
0
0

I have an excel workbook with multiple tabs and I created a Windows scheduled task to open the workbook and save the workbook to pdf however there is a error with this portion of the code when i debugged it. I think it may be the previous instance that had processed and left the same pdf in the same folder. It may not be overwritting the old pdf.

ERROR Run Time Error '-214701887 (80071779)'; Document not saved.

ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _Filename:=saveLocation

FULL VBA

    Sub Auto_Open()Dim sht As Worksheet'AutoFit Every Worksheet Column in a Workbook  For Each sht In ThisWorkbook.Worksheets    sht.Cells.EntireColumn.AutoFit  Next shtApplication.DisplayAlerts = False'Create and assign variablesDim saveLocation As StringsaveLocation = "C:\Users\manuel\Documents\SQL Server Management Studio\alert-email\LOG.PDF"Application.DisplayAlerts = True'Save active workbook as PDFActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _    Filename:=saveLocationDim OutLookApp As ObjectDim OutLookMailItem As ObjectDim myAtttachments As ObjectSet OutLookApp = CreateObject("Outlook.Application")Set OutLookMailItem = OutLookApp.CreateItem(0)Set myAttachments = OutLookMailItem.AttachmentsWith OutLookMailItem.To = "manuel@gmail.com".Subject = "Test Summary".Body = "This e-email is automatically generated and will be sent every weekday at 6AM. We can customerize and add more reports later."myAttachments.Add "C:\Users\manuel\Documents\SQL Server Management Studio\alert-email\LOG.PDF".send'.DisplayEnd WithSet OutLookMailItem = NothingSet OutLookApp = NothingThisWorkbook.SaveThisWorkbook.Saved = TrueApplication.QuitEnd Sub

I would like to create a very simple pivot table using vba, but I keep getting errors with my pivot cache

$
0
0

I have put together some VBA for a pivot table to basically just give how many CNs there are per person from the original table. Maybe there is a more simple way to do this, but I have to have code as I plan on adding this code to a macro. I have added a photo of my original table as well as what I am trying to have my pivot table look similar to. I get an error message on the [ With ws.PivotTables("PivotTable1").PivotFields("Type")] line: Unable to get the PivotFields property of the PivotTable class. Any ideas?

Example Table/pivot table photo Thanks!


Sub PivotTableTest2()

Dim ws As WorksheetDim wb As WorkbookDim pc As PivotCacheDim pt As PivotTableSheets("Supplier Quality").ActivateSet ws = ActiveSheetSet wb = ThisWorkbookSet pc = wb.PivotCaches.Create(SourceType:=xlDatabase, SourceData:=ws.Range("Table2"))Set pt = ws.PivotTables.Add(PivotCache:=pc, tabledestination:=ws.Range("P1"), TableName:="PivotTable1")

'

With ws.PivotTables("PivotTable1").PivotFields("Type")    .Orientation = xlRowField    .Position = 1End WithWith ws.PivotTables("PivotTable1").PivotFields("Task Owner2")    .Orientation = xlColumnField    .Position = 1End Withws.PivotTables("PivotTable1").AddDataField ActiveSheet.PivotTables( _"PivotTable1").PivotFields("Type"), "Sum of Tasks Overdue", xlSum

End Sub

VBA. How to download text instead of .csv from webpage

$
0
0

The following macro downloads data (prices, volume…) from Yahoo Finance for a given stock and a range of dates.The steps are:

  1. Compose URL
  2. Download and save csv file
  3. Import csv to a string
  4. Parse the string to Excel
  5. Delete csv file
Sub main()Dim dirlocal As StringDim ticker As StringDim date1 As Long, date2 As Long'Path of the folder I want to download the data indirlocal = Application.ActiveWorkbook.pathticker = "KO" 'The CocaCola Companydate1 = 43831 '01/01/2020date2 = 43861 '31/01/2020Call download_CSV(dirlocal, ticker, date1, date2)End Sub
Sub download_CSV(dirlocal As String, ticker As String, date1 As Long, date2 As Long)'Create excel file that will contain the downloaded dataDim Dir_xls As StringITDir_xls = dirlocal & "\" & ticker & ".xlsx"Dim wb As WorkbookSet wb = Workbooks.Addwb.SaveAs Dir_xls'DOWNLOAD DATA. -1- Compose URLDim URL As StringDim dat1 As Long, dat2 As Long'I need to "scale" the dates for the web page to understand me:dat1 = (date1 - 25569) * 86400dat2 = (date2 - 25569) * 86400URL = "https://query1.finance.yahoo.com/v7/finance/download/" & ticker & "?period1=" & dat1 & "&period2=" & dat2 & "&interval=1d&events=history"'DOWNLOAD DATA. -2- Save csvDim Dir_csv As StringDir_csv = dirlocal & "\" & ticker & ".csv"Dim WinHttpReq As ObjectDim ostream As ObjectSet WinHttpReq = CreateObject("Microsoft.XMLHTTP")WinHttpReq.Open "GET", URL, FalseWinHttpReq.sendIf WinHttpReq.Status = 200 Then    Set ostream = CreateObject("ADODB.Stream")    ostream.Open    ostream.Type = 1    ostream.Write WinHttpReq.responseBody    ostream.SaveToFile Dir_csv, 2    ostream.CloseElse    MsgBox (WinHttpReq.Status & " : Not found")End If'DOWNLOAD DATA. -3- Import csvDim strText As String'Read utf-8 file to strText variableWith CreateObject("ADODB.Stream")    .Open    .Type = 1  ' Private Const adTypeBinary = 1    .LoadFromFile Dir_csv    .Type = 2  ' Private Const adTypeText = 2    .Charset = "utf-8"    strText = .ReadText(-1)  ' Private Const adReadAll = -1End With'DOWNLOAD DATA. -4- Parse strText to worksheetDim ws As Worksheet 'Worksheet I want to place the data inSet ws = wb.Worksheets(1)Dim introw As LongDim strLine As Variantintrow = 1Application.DisplayAlerts = FalseFor Each strLine In Split(strText, Chr(10))    If strLine <> "" Then        With ws            .Cells(introw, 1) = strLine            .Cells(introw, 1).TextToColumns Destination:=Cells(introw, 1), DataType:=xlDelimited, _                TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _                Semicolon:=False, Comma:=True, Space:=False, Other:=False        End With'Ignore line if price is "null"        If ws.Cells(introw, 5) <> "null" Then            introw = introw + 1        End If    End IfNext strLine'Delete csv fileKill Dir_csv'Save excel filewb.Savewb.CloseEnd Sub

I am not familiar with the "Microsoft.XMLHTTP" and "ADODB.Stream" objects. I managed to make the macro work by looking on the internet.

I was wondering if, for the sake of simplicity -and maybe efficiency- it would be possible to skip saving the csv and instead downloading the string right away, so I tried merging the steps 2 and 3 into this:

'DOWNLOAD DATA. -2&3- Get StringDim strText As String 'Aimed stringDim WinHttpReq As ObjectDim ostream As ObjectSet WinHttpReq = CreateObject("Microsoft.XMLHTTP")WinHttpReq.Open "GET", URL, FalseWinHttpReq.sendIf WinHttpReq.Status = 200 Then    Set ostream = CreateObject("ADODB.Stream")    With ostream        .Open        .Write WinHttpReq.responseBody        .Type = 2  ' Private Const adTypeText = 2        .Charset = "utf-8"        strText = .ReadText(-1) ' Private Const adReadAll = -1    End WithElse    MsgBox (WinHttpReq.Status & " : Not found")End If

I get the error

Operation not allowed in this context

in this line

.Write WinHttpReq.responseBody

Is it possible to skip saving, importing and deleting the csv file?

If so, how?

Thanks in advance.

Repairing excel file on the fly or Bypass repair window

$
0
0

I am downloading multiple ".xlsm" excel files from a website. Saving them down with Python, but then when I try to open them I get the below message:

"We found a problem with some content in "Worbook1.xlsm". Do you wantus to try to recover as much as we can? If you trust the source ofthis workbook, click Yes"

I noticed that if I open and repair, I can then manually save the repaired file with another name, and that new saved file opens fine (ie, no repair message). But it is not ideal to do this with all the files. I would like to perform it with Python.

If it helps, the excel repair messages are:

  1. "Removed records: Named range from /xl/workbook.xml part (Workbook)"
  2. "Removed records: Workbook properties from /xl/workbook.xml.part (Workbook)"

Computing p-values for a particular datapoint under a distribution in Excel

$
0
0

I have a set of data in Excel like this:

-39.086-39.082-39.06-39.058-39.037-39.034-39.03-39.002-38.996-38.996-38.949-38.944-38.944-38.939-38.933-38.882-38.846-38.836-38.833-38.833-38.829-38.817-38.813-38.794

This is just a snippet of my dataset. My question is, how can I calculate the p-value for a particular datapoint input (e.g. -50) based on the normal distribution of the dataset? Essentially, I want to calculate a p-value for every single datapoint in my set based on its particular location in relation to the mean of the normal distribution.

Averaging Countifs from Multiple Weeks of Data by Hour

$
0
0

I'm attempting to show by hour how many calls are occurring on a weekly basis averaged across a month.

By Rep A, is the user in question, Data M is the column for user, Data E is the time stamp(1:15PM), and Data D is the date(MDY).

This is the function I am using:

=AVERAGE(COUNTIFS(Data!M:M,'By Rep'!A3,Data!E:E,">=8:00AM",Data!E:E,"<9:00AM",Data!D:D,">5/31/2020",Data!D:D,"<6/6/2020"),COUNTIFS(Data!M:M,'By Rep'!A3,Data!E:E,">=8:00AM",Data!E:E,"<9:00AM",Data!D:D,">6/7/2020",Data!D:D,"<6/13/2020"),COUNTIFS(Data!M:M,'By Rep'!A3,Data!E:E,">=8:00AM",Data!E:E,"<9:00AM",Data!D:D,">6/14/2020",Data!D:D,"<6/20/2020"),COUNTIFS(Data!M:M,'By Rep'!A3,Data!E:E,">=8:00AM",Data!E:E,"<9:00AM",Data!D:D,">6/21/2020",Data!D:D,"<6/27/2020"))

I'm averaging the countifs from each week for the one hour I am looking at call times for. Now the thing is that the output provides numbers for each hour I am looking at, but for some reason 9AM-10AM and 12PM-1PM show zeroes across the board for all users even though I clearly see data for those times in the report. I've tried changing the formatting for time and did a text to column for both the date and time fields and regardless of what I try, those two time sets do not provide any results. Are my formulas just way off or is there some sort of formatting issue I'm missing? Appreciate any help!

Calculation Results

Calculation Results

Date/Time Data

Date/Time Data

Viewing all 89424 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>