Joyanta Mitra

About author

Joyanta Mitra, a BSc graduate in Electrical and Electronic Engineering from Bangladesh University of Engineering and Technology, has dedicated over a year to the ExcelDemy project. Specializing in programming, he has authored and modified 60 articles, predominantly focusing on Power Query and VBA (Visual Basic for Applications). His expertise in VBA programming is evident through the substantial body of work he has contributed, showcasing a deep understanding of Excel automation, and enhancing the ExcelDemy project's resources with valuable programming insights.

Designation

Excel and VBA Content Developer at ExcelDemy, SOFTEKO.

Lives in

Dhaka, Bangladesh.

Education

B.sc in Electrical and Electronic Engineering, Bangladesh University of Engineering and Technology.

Expertise

Verilog, Micropython, Mikroe C, Java(Core+TCP/IP), Digital design, Matlab, Assembly Programming.

Project

  • Java games: Snake, Sudoku, Reinforcement Learning using Gym and Anaconda.

Research

  • Ion Energy Distribution in Plasma, Prediction of Uniform Energy Electron Location.

Latest Posts From Joyanta Mitra

0
IF with ISERROR Function in Excel: 4 Practical Examples

Here's an overview of using the IF and ISERROR functions to check a car's unit price depending on the amount of available stock. What Is ISERROR in ...

0
How to Create Files From Excel List

Step 1 - Launch VBA Editor Go to the Developer tab. Select Visual Basic. Step 2 - Insert a Module Select Insert, Select Module. A ...

0
How to Rank in Excel Highest to Lowest (13 Handy Examples)

In this article, we'll use a dataset of sales from some sales representatives to demonstrate how to rank in Excel highest to lowest in 13 different cases. ...

0
How to Create Drop Down List from Another Workbook in Excel

Create a master dataset and save the file as “Master Dataset”. You can name it anything you want. Our workbook’s name is Master Dataset. Create ...

0
How to Use Target Address in Excel VBA (3 Examples)

  The sample dataset contains the production and selling prices of different mobile phones. We are going to use Target.Address to change cell ...

0
Reasons And Solutions for Excel Object Required Error in VBA

The object required error in VBA occurs when you attempt to perform an operation on a variable or object that is not set or initialized. This error can be ...

0
How to Use the Excel Color Scale Based on Text – 2 Examples

This is an overview.  How to Add Color Scales in Excel Select the column. Go to Home>>Conditional Formatting>>Color Scales and ...

0
Excel VBA to Find Matching Value in Column: 8 Examples

Method 1 - Using Match Function to Find One Matching Value in Column Find the Match value of the Model according to order ID. Prepare some cells for ...

0
Pop Up Excel VBA MsgBox When Cell Meets Criteria

How to Launch the VBA Editor in Excel You need the Developer tab to display on your ribbon. If you don’t have it, check how to enable the Developer tab on ...

0
How to Use the Excel VBA MsgBox Title – 5 Examples

This is an overview: Excel VBA MsgBox Syntax of the VBA MsgBox Function in Excel MsgBox( prompt ) prompt – shows the message. ...

0
How to Create a Fuel Cost Calculator Using an Excel Formula (2 Examples)

    Method 1 - Creating a Fuel Cost Calculator for Business Purposes Steps: Create a data chart of odometer readings, state-wise fuel cost ...

0
How to Limit Decimal Places in Excel (5 Methods)

Why Is Limiting Decimal Necessary? To ensure clean and efficient calculations, we often round our decimal values. For instance, instead of using 3.399, we ...

0
How to Use Excel LARGE Function with Duplicates in Excel: 3 Ways

Method 1 - Nesting LARGE, COUNTIF, MAX, MIN, INDIRECT, and ROW Functions to Find the N-th Largest Value from Data That Contains Duplicates Steps: Use ...

0
How to Perform Bilinear Interpolation in Excel (Easy Steps)

Bilinear interpolation is a technique used to estimate function values for two variables when the actual function is unknown. In Microsoft Excel, you can ...

Browsing All Comments By: Joyanta Mitra
  1. Dear April
    Thanks for your concern. There were some minor formatting issues with the VBA codes. Sorry for the inconvenience. We have updated our article. If you follow now, you will get the perfect calculator.
    Thanks for your help
    Regards,
    Joyanta Mitra
    ExcelDemy

  2. Dear Adam,
    Thank you for your concern. You can not change the color of Excel button but you can use Command Button to change the button color.
    You can follow the steps below to color your command button:
    1. use Developer tab > Insert > ActiveX Controls > Command Button.
    Adding Command button
    2. A command will appear and right click on it.
    3. Choose CommandButton Object > Edit.
    right click on the command button
    Name the button as Start.
    4. Now right click on the command button and choose View Code.
    view code
    5. Then write code below for starting.

    
    Private Sub CommandButton2_Click()
    countDown = Now + TimeValue("00:00:01")
    Range("B4") = Range("B4") + TimeValue("00:00:01")
    Application.OnTime countDown, "StartTimer"
    CommandButton2.BackColor = 13959039
    End Sub
    

    Finally the button color has been added.
    start button colored
    6. Now create a stop buttom and use the code below:

    
    Private Sub CommandButton1_Click()
    Application.OnTime EarliestTime:=countDown, Procedure:="StartTimer", Schedule:=False
    CommandButton1.BackColor = 13959039
    End Sub
    

    7. Write down the code for reset button:

    
    Private Sub CommandButton3_Click()
    Range("B4") = TimeValue("00:00:0")
    CommandButton3.BackColor = 13959039
    End Sub
    

    Finally, you will have colored command button. You can change the color by changing color code 13959039.
    Final result

  3. Dear Kelley Sauer,
    Please use this formula below to count sales having date.
    =COUNTIF(E5:E14, "<>")
    Count cells when date is used
    It will count all sales with date. Using this formula, you will not get zero anymore. Moreover I have also used Ctrl+: to insert date.
    With Regards,
    Joyanta Mitra

  4. Dear Anas,
    You have to write the following code to get data validation for duplicate values, you have write the code below.

    
    Sub CreateUniqueDropDownListInC12()
        Dim ws As Worksheet
        Dim cell As Range
        Dim dict As Object
        Dim dataValidation As Validation
        Dim dvList As String
        
        ' Define the worksheet where you want to apply the data validation
        Set ws = ActiveSheet
        
        ' Create a dictionary object to store unique values
        Set dict = CreateObject("Scripting.Dictionary")
        
        Application.ScreenUpdating = False
        
        ' Loop through the specified range (C5 to C11)
        For Each cell In ws.Range("C5:C11")
            If cell.Value <> "" Then ' Check for non-empty cells
                If Not dict.Exists(cell.Value) Then
                    dict(cell.Value) = 1 ' Add the value to the dictionary
                End If
            End If
        Next cell
        
        ' Convert the unique values to a comma-separated string for data validation
        dvList = Join(dict.Keys, ",")
        
        ' Apply data validation with a dropdown list to cell C12
        Set dataValidation = ws.Range("C12").Validation
        With dataValidation
            .Delete
            .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:=xlBetween, Formula1:=dvList
            .IgnoreBlank = True
            .InCellDropdown = True
            .ShowInput = True
            .ShowError = True
        End With
        
        Application.ScreenUpdating = True
    End Sub
    

    Then we get the data values of unique departments Marketing and Sales.
    datavalidation with duplicates
    With regards,
    Joyanta Mitra

  5. Dear Santosh Kumar,
    Please clarify the question. How can a person do more than 24 hours in 24 hours?
    With Regards.
    Joyanta Mitra

  6. Dear FRANCESCA BATHE,
    End Position is given according to column To. Where there is RENT in To column, the number starts 1,2,3,4 and ends with SPACE1 numbered 5. Then next is Food starting 6,7,8, 9 and ends with SPACE2 numbered 10. Likewise, numbering is done for every cell data in End Position.
    Numbering End position
    Regards,
    Joyanta Mitra

  7. Code is alright. Please inform your particular problem.

  8. Dear Prince,
    Thank you very much for reading our article.
    According to your query, 1st you wanted to know about a formula to create a drop-down list that will be used to select different types of leaves. You will get that in Step 3 of this article. In our Excel file, we selected leave using the drop-down list in Record sheet. Also when you move to any month leave information will be based on the Record sheet. So, information will not move from one month to another. Try this and hope you will get the solution.
    Otherwise, send your Excel file with what you want to get and we will try to provide a solution. You can mail us at [email protected].
    Thanks
    Joyanta Mitra
    ExcelDemy

  9. Dear Karlyn Martinez,
    For your convenience, I have showed the task with following steps.
    Steps:
    ● First, you have to recognize the pattern in the formula
    Showing pattern
    ● You can use Format Painter or drag the row to add a new row or rows for editing new data.

    Modifying data
    ● Now add new data.

    Adding new data
    ● Inset new rows in the Summary sheet.
    Inserting new rows in Summary sheet
    ● Insert the Entire row.
    Inserting new row
    ● Edit the code according to the main dataset. As now in Jan worksheet, new data is added, and so the range will be changed to AH$15 and $B$15.
    Showing the formula change

    Hope, this will be helpful for you.

    Regards,
    Joyanta Mitra
    Excel & VBA Content Developer

  10. This code will solve your problem. The code has a condition checking values blank or not.

    Sub Duplicates_Dif_Colors()
    Dim RG As Range
    Dim TT As String
    Dim CL As Range
    Dim CR As String
    Dim CP As Range
    Dim CD As Long
    Dim Cltn As Collection
    Dim J As Long
    
    On Error Resume Next
    
    If ActiveWindow.RangeSelection.Count > 1 Then
    TT = ActiveWindow.RangeSelection.AddressLocal
    Else
    TT = ActiveSheet.UsedRange.AddressLocal
    End If
    
    Set RG = Application.InputBox("Select range of data with duplicates:", "Duplicate values with Colors", TT, , , , , 8)
    If RG Is Nothing Then Exit Sub
    
    CD = 2
    Set Cltn = New Collection
    
    For Each CL In RG
    If CL.Value <> "" Then ' check if cell is not blank
    On Error Resume Next
    Cltn.Add CL, CL.Text
    If Err.Number = 457 Then
    CD = CD + 1
    Set CP = Cltn(CL.Text)
    If CP.Interior.ColorIndex = xlNone Then CP.Interior.ColorIndex = CD
    CL.Interior.ColorIndex = CP.Interior.ColorIndex
    ElseIf Err.Number = 9 Then
    MsgBox "Found excessive duplicates", vbCritical, "Duplicates with Colors"
    Exit Sub
    End If
    On Error GoTo 0
    End If
    Next
    End Sub
    

    Output:

    Blank cells not colored

  11. Please write Ticker correctly both in your xlsx file and the code. Do not try to give invalid ticker or outdated ticker. Provide problems in detail for better service please.

  12. First, you have to create different power queries for each worksheet for other tickers and copy the same code. Otherwise, it triggers the first. Then for 10 different tickers,the code is

    
    let
        TickerList = {"AAPL", "GOOG", "MSFT", "AMZN", "FB", "TSLA", "NVDA", "JPM", "BAC", "V"},
        StartDate = Excel.CurrentWorkbook(){[Name="StartDate"]}[Content]{0}[Column1],
        EndDate = Excel.CurrentWorkbook(){[Name="EndDate"]}[Content]{0}[Column1],
        #"Loop Through Tickers" = List.Transform(TickerList, each
            let
                Ticker = _,
                Source = Csv.Document(Web.Contents("https://query1.finance.yahoo.com/v7/finance/download/"&Ticker&"?period1"&StartDate&"&period2"&EndDate),[Delimiter=",", Columns=7, Encoding=1252, QuoteStyle=QuoteStyle.None]),
                #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
                #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Date", type date}, {"Open", type number}, {"High", type number}, {"Low", type number}, {"Close", type number}, {"Adj Close", type number}, {"Volume", Int64.Type}})
            in
                #"Changed Type"
        ),
        #"Loop Through Tickers1" = #"Loop Through Tickers"{8}
    in
        #"Loop Through Tickers1"

    this code creates 10 tables for 10 different tickers. You have to select one table according to Ticker and hover over the query in Workbook Query Section and press View in Worksheet. You will get the table have to create 10 sheets separately.

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo