I am looking an excel sheet to calculate the total count by automatically.
I am creating an excel for attendance management system. There are about 30 students in the class. They are denoted by their registration number (2011/V/01,
2011/V/02, ...., 2011/V/30). They have many classes everyday. The attendance (every students put signature in the attendance sheet) is taken every hours by the lecturers. When the attendance sheets reached to the department, the officer ready to calculate the absentees.
The officer'll type the last number of the registration number for the absent students(Ex: 05 for 2011/V/05).
On starts the total absents is in zero.
When he/she inputs the last number in cell A3 and press enter, immediately the correspondent cell should increment by 1.
In first attendance sheet, registration number of 2011/V/02, 2011/V/05, 2011/V/07 and 2011/V/13 are absents
(Ex: cell A3 = 02 then cell D3 from 0 to 1).
(Ex: cell A3= 05 then cell D6 from 0 to 1).
(Ex: cell A3 = 07 then cell D8 from 0 to 1).
(Ex: cell A3 = 13 then cell D14 from 0 to 1).
In second attendance sheet 2011/V/03, 2011/V/05, 2011/V/13, 2011/V/16 and 2011/V/21 are absents
(Ex: cell A3 = 03 then cell D4 from 0 to 1).
(Ex: cell A3 = 05 then cell D6 from 1 to 2). (absent in first sheet,so 1 to 2)
(Ex: cell A3 = 13 then cell D14 from 1 to 2). (absent in first sheet,so 1 to 2)
(Ex: cell A3 = 16 then cell D17 from 0 to 1).
(Ex: cell A3 = 21 then cell D22 from 0 to 1).
In third attendance sheet 2011/V/03 and 2011/V/05 are absents
(Ex: cell A3 = 03 then cell D4 from 1 to 2). (absent in second sheet,so 1 to 2)
(Ex: cell A3 = 05 then cell D6 from 2 to 3). (absent in second sheet,so 2 to 3)
This'll happen every day until the attendance sheets is computerized.
https://www.flickr.com/gp/93604880#N02/8kv3N0
In the code module for the data-entry sheet:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim student As String, f As Range
If Target.Cells.Count = 1 And Target.Address() = "$A$3" Then
student = "2011/V/" & Format(Target.Value, "00")
Set f = Me.Range("C:C").Find(what:=student, lookat:=xlWhole)
If Not f Is Nothing Then
Me.Range("A3:A4").ClearContents
f.Offset(0, 1).Value = f.Offset(0, 1).Value + 1
Else
Me.Range("A4").Value = "Student not found!"
End If
Me.Range("a3").Select
End If
End Sub
what you want to do is best achieved with a very simple data entry user form.
Google "excel vba data entry user form" and you will found excellent tutorials.
Follow them and come back here to keep reading this answer.
I would create two sheets and one form.
Sheet1 would contain a log of your data entry. With just two columns, date and student code.
Sheet2 would contain the absences count. Again with two columns, column one the list of all of your students and colum two the running count of absences.
Form would contain two controls. One, a single field for the student code (either a text box or, something more elaborate like a combo box, built at initialize time with all the student codes of column 1 of sheet2). And two, a submit button.
On the code for the submit button, you should add some code to take the current date and selected student code, and insert them to the last row of sheet1.
On sheet2, the second column would be a formula, that is simply a count of the lookup results of the corresponding student code into the column 2 of sheet1.
Related
I am maintaining an excel sheet where Sheet1 A1 would be the name of people and B2 would be their contact number. All of the details are in sheet 2 row A and B.
So, what I want is if I put a valid name (i.e. should be in Sheet2 A) then it automatically finds the number of that name and adds in the second row. Is this possible? I have around 10-15 contacts there.
Assuming Sheet workers list is as follows:
then in Cell B2 of Sheet assignment received enter either of the following formulas
=VLOOKUP(A1,'workers list'!A2:B10,2,FALSE)
or
=INDEX('workers list'!B2:B10,MATCH(A1,'workers list'!A2:A10,0))
Change range as required.
Use this formula in sheet -1 B2 cell "=IF(A2="","",VLOOKUP(A2,Sheet2!$A:$B,2,0))"
and Dropdown this formula till you want
Sheet-2
Sheet-1
I want to get the value in a column next to a referenced cell
Example
Sheet Products
A1 = "test"
B1 = "next test"
B2 = "last test"
Sheet Totals
First i get the referenced cell in CEll A 1
A1 = =CELL("address";INDEX(Products!A:A;MATCH(C5;Products!A:A;0);0))
// returns Products$A$1
Now i want to get the value of B1,B2 and so on... based on what is in A1
I know with Indirect(A1) i will get the value of the referenced cell...but i have no clue how to get next to that one and so on....
You can use OFFSET function. The OFFSET function returns a cell or range of cells that is a specified number of rows and columns from a cell or range of cells.
For example, if =INDIRECT(A1) in Sheet Totals gives you test (which is Cell A1 in Sheet Products) as result then to get value of Cell B1 from Sheet Products you'll have to use =OFFSET(INDIRECT(A1),0,1) (same row, next column). Like wise, for Cell B2 from Sheet Products you'll have to use =OFFSET(INDIRECT(A1),1,1) (next row, next coulmn).
For details on OFFSET function see this.
I have 2 sheets. The first sheet has 2 dropdowns with values matching columns in the 2nd sheet in column a and b. based on the user's selections in the sheet one drop downs, I would like to show the content of the cell c of the corresponding row.
For example:
User selects apples in dropdown c3 on sheet 1 and lemons in drop down c5 on sheet 1, both of which match values on sheet 2 in cells a7 and b7, now show the value in cell c7 from sheet 2 on sheet 1 cell c7.
In cell C7 type this formula:
=Index(Sheet2!C:C,Match(C3&C5,Sheet2!A:A&Sheet2!B:B,0))
Then press Ctrl + Shift + Enter so it becomes an array formula.
If you like, you can restrict the rows instead of using the entire column.
This might be confusing but I'll give this a go.
As in the title of this question, I need to link cells between two sheets. Seems simple enough, but I think in this case I need to include an IF function?
I want cell C2 in sheet 1 to display what is in cell B2 from sheet 2 IF cell A1 in sheet 1 is the same as cell B1.
In other words: I have 2 sheets, on the second page I have months in on row and in the row under I have values for those months. I want to be able to link sheet 1 and 2 so that if I select February in one cell in sheet 1, then the cell under February in sheet 2 (the value) is shown in another cell on sheet 1.
Help please?
I think the relationships are satisfied by:
=IF(A1='sheet 2'!B1,'sheet 2'!B2,"")
(in Sheet 1!C2) but have assumed that the result should be nothing if Sheet 1!A1 != Sheet 2!B2.
I think you might be looking for in cell C2 (if you are talking about A1 and B1 being from the same sheet like 1):
=IF(A1=B1,Sheet2!B2)
edit: can't read question, only works if A1 and B1 are on same sheet
If I am not misunderstanding your wish, there is the code below. Please insert it into cell C2 in Sheet1
=IF(A1=B1, Sheet2!B2, "")
But you did not provide what sheet of cell B1 in pharse
I want cell C2 in sheet 1 to display what is in cell B2 from sheet 2 IF cell A1 in sheet 1 is the same as cell B1
So, I assumed that it is the same as A1 that is Sheet1. If you want to compare with the cell B2 in another sheet please Insert Sheet2: before B1.
Row 1: 2013 2014
Row 2: 1 2 3 4 5 1 2 3 4 5
I have these two rows in excel (the second row is actually the no of week in the year); two merged cells in row 1 and 10 cells in row 2. (Sorry I don't know how to format it nicely here)
The criteria is as follow. There is a cell, say cell C1, to indicate the year, and another cell C2 to indicate the no of the week. My question is that how can i get excel to automatically select a cell in row 2 matching the criteria stated in cell C1 and cell C2? Cell C1 and C2 are inputs by user.
I hope it's understandable, I have tried to explain it as clear as possible but please let me know if the question is not clear. This is all done in Excel.
Appreciate any kind answer to my problem above. Thanks.
In cell A1 I have put the year 2013. This cell is merged with cell B1. In cell G1 I have put year 2014. This again is merged with cell H1. These two cells are in Row 1. Below these cells under each year I have entered 1,2,3,4,5 in seperate cells indicating weeks.
The user inputs year in Cell C5 and week number in Cell C6.
I have put a command button below the input cells to enable user click after entering values. In the Command button click event I have written the following code:
For i = 1 To 5
If Cells(5, 3) = Cells(1, 1) And Cells(2, i) = Cells(6, 3) Then
Cells(2, i).Activate
End If
Next
For j = 6 To 10
If Cells(5, 3) = Cells(1, 7) And Cells(2, j) = Cells(6, 3) Then
Cells(2, j).Activate
End If
Next
Now after entry of year and week, with the click of button the cell containing the week number under the corresponding year is selected.
Below the input cell means either Cell C7 or C8 or C10.
The command button can be drawn from Veiw menu - Tool Bars - Visual Basic. When you get the menu bar of the visual basic tools just drag the command button on to Cell C7 or C8 and resize it and give a meaningful caption.
When the button is double clicked it opens the code window onto which you can copy the code I have given under Command_Button_Doubleclick Event.
Then you can run the code and get the work done.