Wednesday 21 December 2022

Macro to compare two data sets

 1. Object of the macro


a)The data is populated as follows:




b) I want to compare based on the Unique identifier List A and List B

c) Highlight the common items in List A and List B

d) Get populated in Sheet 2, items present in List A, but not in List B

e)Get populated in Sheet 3, items present in List B, but not in List A



2. Code

Sub Comparedatasets()

Application.ScreenUpdating = False

lr1 = Range("A" & Rows.Count).End(xlUp).Row

lr2 = Range("D" & Rows.Count).End(xlUp).Row

Sheets(1).Range("A2", "B2").Copy

Sheets(2).Range("A1").PasteSpecial Paste:=xlPasteValues

Sheets(3).Range("A1").PasteSpecial Paste:=xlPasteValues

check = False

For r = 3 To lr1

Set compare1 = Cells(r, 1)

For q = 3 To lr2

Set Compare2 = Cells(q, 4)

If compare1 = Compare2 Then Compare2.Interior.Color = vbYellow: check = True

Next q

If check = False Then

Range(compare1, compare1.End(xlToRight)).Copy

Sheets(3).Range("A" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial _Paste:=xlPasteValues

End If

check = False

Next r  

check = False

For r = 3 To lr2

Set compare1 = Cells(r, 4)

For q = 3 To lr1

Set Compare2 = Cells(q, 1)

If compare1 = Compare2 Then Compare2.Interior.Color = vbYellow: check = True

Next q 

If check = False Then

Range(compare1, compare1.End(xlToRight)).Copy

Sheets(2).Range("A" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial _Paste:=xlPasteValues

End If

check = False      

Next r

Application.ScreenUpdating = True

End Sub



3) Result  



 






Wednesday 14 December 2022

Diaries on VBA- Scripting Dictionary

 

1. Part 1- Basics of Dictionary


a) Dictionary is used to assign a value to a key/item

b)Syntax

i) If I want to create Gowtham as new dictionary

Dim Gowtham as Newdictionary

ii) Add items to the dictionary Gowtham

For Eg. I want to assign 1 to a, 2 to b


gowtham. add(a,1)

gowtham. add(a,2)


c) When a key is not already declared and is called later, it will get created in dictionary

For Eg,



Sub usedictionary()


Dim dict As New Dictionary


dict.Add "a", 1

dict.Add "b", 2

dict.Add "c", 3

dict("d") = dict("d") + 100


Debug.Print dict("d")

 

End Sub


..., the above code will print 100 

Tuesday 6 December 2022

Macro to count the number of characters in cells and populate the data set sperately

  1. Object of  the Macro



I want to:

  • count the number of HSN digits in Column A, 
  • get them populated in Column C, 
  • filter the items with HSN less than 6 digits and
  • get the dataset pasted at the cell H1.



2. The Code


Sub countcharactersincell()

Dim a As String

Dim b As Integer

Dim i As Integer

Dim j As Integer

Dim k As Integer

j = Cells.End(xlDown).Row

For i = 2 To j

a = Cells(i, 1) 

b = Len(a)

Cells(i, 3) = b

Next i

Range("A1").AutoFilter Field:=3, Criteria1:="<6"

Range("a1:c" & Range("a1").End(xlDown).Row).SpecialCells(xlCellTypeVisible).Copy

Cells(1, 8).PasteSpecial

End Sub


3. Output 




Funfact:

The same output could be achieved with a simple "Sorting" option of Excel. 

But, I'm crazy about those "Mootai poochiyai kollum navina machine"

 

Monday 28 November 2022

Tech Hack Tit-Bits

1. Convert YouTube Videos into Pdf pages using


2. Need a disposable mail for temporary use like signing up..? Here you go, 



3. Need to do content writing, without travail.. 




(will add more..)

Sunday 7 August 2022

Trade Strategies

 1. MACD Trend Following Strategy


A general MACD 







https://tradingstrategyguides.com/macd-trend-following-strategy/


2. Using Moving Averages Perfectly



a. For cross over purpose, use both 20 days and 50 days moving average

b. Some stocks might not react to cross over. Hence backtest before you use

c. Use ATR trailing stoploss indicator to fix the exit point

d. Use stochaistics indicator too in addition to the moving average

e. Combining the PSAR or Supertrend with moving average cross-over would giver better results

Technical Indicators

  1. Williams %R

  • This is basically a momentum indicator.
  • The value of the indicator oscillates between 0 and -100.
  • %R reading above -50 means the price is moving upward. A reading near -100 means oversold levels.





2.  MACD

  • The MACD displays a MACD line (blue), signal line (red) and a histogram (green) - showing the difference between the MACD line and the signal line.




  • When the MACD line crosses ABOVE the zero line, this signals an UPTREND
  • When the MACD line crosses BELOW the zero line, this signals an DOWNTREND

  • When the MACD line crosses ABOVE the signal line, traders use this as a BUY indication
  • When the MACD line crosses BELOW the signal line, traders use this as a SELL indication


  • When the MACD line is above the signal line, then the histogram will be positive. 
  • The opposite is true when the MACD line sits below the signal, whereby the histogram will plot below the zero as a negative value.

3. Stochastic Indicator

The stochastic oscillator has 2 lines (%k) and (%d). 

%K = (C-L5close)/(H5-L5) * 100

%D = 3-day SMA of %K.

where,
C = the most recent closing price.
L5 = the low of the five previous trading sessions.
H5 = the highest price recorded within the same 5-day period.

However, the period can be changed.

The 2 lines cross each other and we consider this as the buy/sell signal. 

We call the %k line crossing the %d line above as the buy signal. Whereas we call the %k crossing the %d line below as the sell signal.

The traders consider a stochastics value close to 0 as oversold, i.e, market is enough sold and can bounce back any time. Whereas they consider the stochastics value close to 100 as overbought, i.e, the market is enough bought and can take a correction any time.




Wednesday 15 June 2022

194R- TDS on benefits or perquisites provided

 

1.       Transactions covered: Any benefit or perquisite, whether convertible into money or not

2.       Rate of TDS: 10%

3.       Threshold for deduction: Value of benefit/perquisite should be more than Rs. 20,000

4.       Payee: Only resident payees are covered u/s 194R.

5.       Who are liable to deduct tax: Persons whose turnover in the business or profession is greater than Rs. 1 Crore or Rs. 50 Lakhs in the preceding previous year

6.       When to deduct tax: At the time, when the benefit/perquisite is provided

7.       Intent behind the introduction of the provision

As per section 28(iv) of the Income tax Act, the value of any benefit or perquisite, whether convertible into money or not, arising from business or exercise of profession is to be charged as business income in the hands of the recipient of such benefit or perquisite. However, in many cases, such recipient does not report the receipt of benefits in their return of income, leading to furnishing of incorrect particulars of income

It has been noticed that as a business promotion strategy, there is a tendency on businesses to pass on benefits to their agents. Such benefits are taxable in the hands of the agents. In order to track such transactions, I propose to provide for tax deduction by the person giving benefits, if the aggregate value of such benefits exceeds Rs. 20,000 during the financial year.

(Para 138 of FM’s speech, Budget 2022-23)

8.       Circular 12/2022- Guidelines for implementation of Section 194R

a.       Deductor is under no obligation to check to whether the benefit provided is taxable as business income for the recipient or not.

b.      TDS shall be deducted even on benefits/perquisites provided in the nature of cash.

c.       TDS shall be deducted even on capital assets provided as benefit/perquisite.

d.      TDS need not be deducted on sales discount, cash discount and rebates.

e.      TDS shall be deducted on free samples.

f.        Value of benefit/perquisites

                                                               i.      Generally, value would be Fair market value of the perquisite

                                                             ii.      The value of the perquisite shall exclude the GST component




g.       Benefit/Perquisite given to social media influencers for product promotion




h.      Reimbursement of out-of-pocket expenses incurred by service provider

                                                               i.      Let’s say, A provides consultancy service to B. A incurs travel expense in the course of business. If this travel expense is invoiced in the name of A and B reimburses the travel expense to A/pays the travel expense directly, B is liable to deduct TDS u/s 194R. 

                i.         Expenditure incurred on dealers conference to educate dealers

                                                               i.      TDS shall not be deducted if:

1.       Conference is not in the nature of incentives/benefits to select dealers/customers who have achieved particular targets

                                                             ii.      TDS shall be deducted if:

1.       Expenditure incurred in the nature of leisure trip or leisure component, even if it is incidental to the dealer/business conference

2.       Expenditure incurred for family members accompanying the person attending dealer/business conference

3.       Expenditure on participants of dealer/business conference for days which are on account of prior stay or overstay beyond the dates of such conference

j.        How shall tax be deducted in case the benefit/perquisite is in kind?

                                                               i.      Recipient shall pay tax through advance tax challan.

                                                             ii.      Deductor shall obtain a declaration along with a copy of advance tax challan.

                                                            iii.      In the TDS return, the same shall be reported along with challan number

                                                           iv.      Form 26Q would carry the provisions for the same starting from this year

Alternatively,

i.         The benefit provider may pay the tax on behalf the benefit recipient.

ii.     The benefit provided shall include the tax paid and tax shall be deducted accordingly. i.e., Grossing-up provisions shall apply.

k.       For the calculation of liability as to whether the threshold limit of Rs. 20,000/- has been exceeded during the year or not, benefits provided since 01.04.2022 shall be taken into account.  

                                                                      

 

 

 

 

 

 


Monday 18 April 2022

Getting unlimited storage in Google Drive for free

 Step 1

You need to go to one of the following sites:

https://td.msgsuite.workers.dev/

https://td.crackhub.site/

https://td.hackgence.com/


Step 2

 Insert Shared Drive name (My games, Free storage, etc.) & Your Gmail (You have to use the Gmail of your Google Drive account) & Click Submit or Create (depends on link), And that's it! You have an unlimited Google Drive Shared drive! To access it all you need to do is go to https://drive.google.com/ -> Shared Drives and you will see a new Shared drive there!


*Note: Please do not keep there any kind of personal files because there's a small chance that the shared drive will be deleted, Using this shared drive at your own risk.


Credit:  https://t.me/Re5ourceHub

Wednesday 23 February 2022

A Primer on deduction u/s 80CCD(1B) through contribution National Pension System

 Introduction
  • Generally, the deduction u/s

-80C (that allows deduction in respect of investment LIC, Housing loan principal repayment, Children education fee etc...),

-80CCC(deduction in respect of contribution for contract of annuity for receiving pension offered by LIC or other insurers)

is restricted to Rs. 150,000/-

  • However, if a person wishes to claim deduction in excess of Rs. 150,000, he/she can avail the deduction of Rs. 50,000 over and above the Rs. 150,000 aforesaid through investing in the notified pension schemes u/s 80CCD

  • The notified schemes are governed by the National pension system trust
Opening an account under National Pension Scheme(NPS)

  •  Opening an account with NPS provides a Permanent Retirement Account Number (PRAN), which is a unique number and it remains with the subscriber throughout his lifetime. The scheme is structured into two tiers:

1. Tier-I account:

This is the non-withdrawable permanent retirement account into which the regular contributions made by the subscriber are credited and invested as per the portfolio/fund manager chosen of the subscriber.

The additional deduction of Rs. 50,000/- is available only for contributions made to NPS Tier I accounts

2. Tier-II account:

This is a voluntary withdrawable account which is allowed only when there is an active Tier I account in the name of the subscriber. The withdrawals are permitted from this account as per the needs of the subscriber as and when required.

Contributions to Tier II accounts are not eligible to claim the deduction under Section 80CCD(1B)

  • There are a quite a few Pension fund managers offering to open NPS accounts with them. One can choose to open an NPS account with any of the Pension fund managers based on their historical performance.

  • The money invested in NPS is managed by PFRDA-registered Pension Fund Managers.

    Currently, there are seven pension fund managers namely:

    ICICI Prudential Pension Fund,
    LIC Pension Fund,
    Kotak Mahindra Pension Fund,
    Aditya Birla Sun Life Pension Management Ltd.
    SBI Pension Fund,
    UTI Retirement Solutions Pension Fund,
    HDFC Pension Management Company, and


  • One always has the option of changing the scheme and fund manager in the course of the investment. 

Contribution to NPS

  • One have to contribute a minimum of Rs 6,000 every year in his Tier-I account in a financial year

  • One can contribute any amount over and above Rs. 6,000 according to his preference.

  • Minimum amount per contribution is Rs. 500

Withdrawal from the NPS
  • At the age of 60,

    -one can withdraw up to 60% of their accumulated wealth in their NPS account ( This lump-sum withdrawal is tax-free u/s 10(12A) of Income tax act, 1961) and 

    -the balance 40% needs to be compulsorily utilized for the purchase of annuity providing monthly pension schemes from one of the Annuity service providers empanelled by PFRDA namely Life Insurance Corporation of India,  SBI Life Insurance, ICICI Prudential Life Insurance, Bajaj Allianz Life Insurance, Star Union Dai-ichi Life Insurance, Reliance Life Insurance, HDFC Standard Life Insurance

  • Thereafter, the annuity income that would arise in hands of the investor will be taxable.

  • One can choose to postpone the withdrawal till the age of 70.

Pre-mature withdrawal from the NPS
  • One can also withdraw from his NPS account before maturity subject to a maximum of
    25% of his erstwhile contribution. This is also subject to the fulfillment of the following conditions:

    • The Partial withdrawal shall be allowed for specific purposes such as higher education of children, marriage of children, purchase or construction of residential house or for treatment of specified diseases.

    • Individual should have subscribed to NPS for at least 3 years.

    • Maximum of 3 withdrawals during the entire tenure are allowed.

    • Minimum gap of 5 years is required between the two withdrawals. However, this condition shall not apply in case of withdrawal for treatment of specified illness.

  • This withdrawal amount is exempt from income tax u/s 10(12B)  of the Income tax act, 1961.

  • In case the assessee dies, and the nominee decides to close the NPS account, then the entire amount will be paid to the nominee and will be exempt from taxation

Exit from the scheme before retirement
  • If a person decides to exit from the scheme before the age of 60, he will have to invest 80% of the accumulated wealth in an annuity scheme. The remaining 20% will be given to the person as a lump-sum payment

Choice of investment
  • The NPS offers you two approaches to invest in your account:
                -Active choice- Individual Funds (E, C and G Asset classes)
                  -Auto choice- Lifecycle Fund
        Active choice - Individual Funds
        • One will have the option to actively decide as to how your NPS pension wealth is to be invested in the following three options:

          • E - “High return, High risk” – investments in predominantly equity market instruments
          • C - “Medium return, Medium risk” – investments in predominantly fixed income bearing instruments
          • G - “Low return, Low risk” – investments in purely fixed income instruments.

        • He can choose to invest his entire pension wealth in C or G asset classes and upto a maximum of 50% in equity (Asset class E).
            Auto choice - Lifecycle Fund

            • NPS offers an easy option for those participants who do not have the required knowledge to manage their NPS investments. In case, he is unable/unwilling to exercise any choice, his funds will be invested in accordance with the Auto Choice option.
            • In this option, the investments will be made in a life-cycle fund.

            • Here, the fraction of funds invested across three asset classes will be determined by a pre-defined portfolio.
            • At the lowest age of entry (18 years), the auto choice will entail investment of 50% of pension wealth in “E” Class, 30% in “C” Class and 20% in “G” Class. These ratios of investment will remain fixed for all contributions until the participant reaches the age of 36.
            • From age 36 onwards, the weight in “E” and “C” asset class will decrease annually and the weight in “G” class will increase annually till it reaches 10% in “E”, 10% in “C” and 80% in “G” class at age 55


            How to invest in NPS

            • One can approach any of the Points of Presence(POP) mentioned in the last page of the following document to invest in the NPS of their choice

            https://npscra.nsdl.co.in/download/NEW_WELCOME_KIT396945283.pdf


            • One can use the following pension calculator to estimate their pension needs


            • The following chart describes the performances of the NPS schemes managed by the aforesaid pension fund managers as at 31st January, 2022







            Source: https://www.npstrust.org.in/sites/default/files/Scheme%20A1%20Jan%202022.pdf


            Sources:

            Monday 21 February 2022

            Uninstall system apps like Youtube, Chrome, Google from your Android

            Your default android apps like Youtube, Chrome, Google etc.. are sucking hijacking focus and time? Unable to find the option to uninstall them? Here's the way-out. There's always an option of uninstalling them present. But we have to go round about to achieve this and we have to use our desktop to do this.This post is an explainer on how to uninstall these zombies. Here we go!!!

            1. Enable Developer options on the phone

            Go to Settings > About phone on your Android phone. Then tap 7 times consecutively on “Build number” to enable Developer Options.

            The location of the build number may vary slightly based on the device, Android version, and Android skin. For example on Huawei phones on EMUI 9, you will need to go to Settings > System > About phone.


            2. Enable USB Debugging

            In Redmi, it doesn't come by default. One needs to go to Setting>About phone>Tap on MIUI version about 8 times in order to enable USB debugging.


            Now you need to go to Developer Options and enable “USB Debugging”. USB Debugging allows you to use ADB (Android Debug Bridge) commands.

            Go to Settings > System > Advanced > Developer Options. Then enable the switch for “USB Debugging”.

            3. Download Platform Tools

            Download the platform-tools (ADB and fastboot) on your Windows PC. You can skip this part if using a Linux computer or a Mac.

            One can download ADB from the following URL:


            https://developer.android.com/studio/releases/platform-tools

            https://androidmtk.com/download-universal-adb-driver

            (Click on the link "Download SDK Platform-Tools for Windows")

            4. Find the package name of the app to uninstall

            Open a command window or Terminal in your platform-tools folder. Then run the following set of commands to get a list of the package names of the apps currently installed on your phone.

            adb shell – to open an ADB shell

            pm list packages – to list all of the currently installed packages


            5. A. Copy the package name of the app which you want to uninstall and then proceed further.

            B. If you are unable to find out the actual app name from the package name, then you can use the Android app “Package Name Viewer” on your phone to find out the package name of any installed app.

            C. List installed Android app packages using ADB

            D. You can also find the package name of the app to be uninstalled from playstore. Go to google playstore. Search for the app you want to be uninstalled. For example, if one wants Youtube uninstalled, search for youtube in the playstore. In the address bar, one can find the package name of the app suffixed (Encircled in the below image)





            6. Uninstall the app(s)

            Finally, run the following command within the adb shell to uninstall the app. Remember to replace the package-name with the package name discovered by you in Step 4.


            pm uninstall -k --user 0 package name


            For example, if you want to remove the YouTube app (as in the above screenshot), run the following command:

            pm uninstall -k --user 0 com.google.android.youtube


            7. You will get a confirmation of a successful uninstall in the form of a “Success” response.

            8. Screenshot of my uninstalling of system apps




            Credits: 

            https://www.techmesto.com/uninstall-pre-installed-apps-from-android-phone/


            https://developer.android.com/studio/releases/platform-tools


            https://androidmtk.com/download-universal-adb-driver

            Thursday 6 January 2022

            MS Excel- Formula to embed accounting/currency format inside a string

            1.)  "&TEXT(Reference cell," #,##0 ;")

            ="Type the characters you want"&TEXT(A1," #,##0 ;")


            How to use it:

            Say, A1 cell has got a formula and it computes and gives me the output of an amount in simple numerics, say, 154358.

            Now, I want to be presented in Rs.

            Here is how I will use the formula

            ="Rs."&TEXT(A1," #,##0 ;")

            Output

            Rs. 1,54,358


            2) Sometimes, the numbers don't get populated in accounting format i.e. -100000 as (100,000)


            a) For that, go to the format cells (Ctrl + 1)

            b) In the custom format, paste the following string in the input box

            _ * #,##0.00_ ;_ * (#,##0.00)_ ;_ * "-"??_ ;_ @_ 

            c) And click Ok