Which statistical test should I use if I have this kind of problem:
I have an income statement for a year, so I decide to divide it into 1st half and 2nd half. then I find the mean for both. What test would be appropriate to determine whether the difference between 1st half and 2nd half is real or due to the number of jobs that the company got in each time perios?
You should probably use a Welch (separate-variances) 2-sample t test. See the formulas in the Wikipedia article.
Because of possible seasonal factors, I think it would be dangerous to use a test that assumes the population variances to be the same in the two halves of the year. The Welch test works well if the incomes for jobs are nearly normally distributed (if not, you should consider using a Mann-Whitney-Wilcoxon signed rank test, not illustrated here.)
Roughly in the notation of the Wikipedia article, you would average the $n_1$ jobs in the first half of the year to get the sample mean $\bar X_1$ and find their sample variance to get $S_1^2.$ Similarly, use the $n_2$ jobs in the second half of the year to get $\bar X_2$ and $S_1^2.$ Then find the degrees of freedom and the $T$-statistic.
Here is an example, with $n_1 =105$ jobs in the first half of the year and $n_2 = 93$ in the second (incomes in thousands of dollars).
Numbers in brackets show the job number of the first income on each line. Notice that some jobs resulted in (mainly small) losses, due to unexpected costs for materials. Some summary statistics are as follows:
Notice that the average income per job \$2,676 for the first half of the year is smaller than the average \$3,698 for the second half of the year. The question is whether these two sample means differ by enough to be statistically significant.
Below is a 'notched' boxplot. The heavy bars at \$2,190 and \$3,698 represent the medians. That the notches do not overlap is a rough indication that population medians for the two parts of the year are different. (As is typical of normal samples of these sizes, the boxplots indicate some mild outliers, which can be ignored, unless a review of invoices reveals a computational error.)
Results of the Welch test in R statistical software are as follows:
The P-value 0.0024 < 0.05 indicates statistical significance at the 5% level. The average income per job tended to be larger in the second half of the year.
Your Question asked for a test that takes the number of jobs into account. Notice that total income for the first half of the year was about \$281,000 and for the second half slightly less about \$244,000. However, on a per job basis, income was greater in the second half of the year. Knowing in which half of the year the company did 'better' would require a more comprehensive analysis of expenses, including advertising, payroll, and so on.
Note: These are fake data. If you are using software that allows you to compute the quantities necessary for the t test from the summary statistic, you can use that software to verify the results for yourself. If $|T| > 1.974$ then reject the null hypothesis that the two halves of the year produce equal average incomes per job at the 5% level of significance.
If you are using R statistical software, which requires the original data, then you can generate the data in R just as I did:
Notice that I used $\mu_1 =3.0$ and $\mu_2 = 3.5$ so it is not astonishing that $H_0: \mu_1 = \mu_2$ is rejected in favor of the alternative $H_a: \mu_1 \ne \mu_2.$