I currently have 2 worksheets in my excel file.
The first sheet is known as the Summary page, which displays an summary result of the second sheet.
The second sheet is known as the raw data. An example would be a column named Fruits.
Apple
Apple
Apple
Banana
Banana
Pear
In the first sheet, I would have a formula that counts the number of time the respective fruits appear and the result will be displayed in different cells.
=COUNTIF(Fruits!A2:A7,"Apple")
=COUNTIF(Fruits!A2:A7,"Banana")
What I wanna do is, is it possible for me to program the formula such that everytime I add a new sheet of raw data (3rd sheet), the statistics on the first sheet is able to reference to the latest sheet to get the information.
(Assuming that the positioning of the data and all are the same as the second sheet.)
What I have done so far is to come out with a function GETLASTWSNAME()
which is able to always retrieve the name of the last worksheet. but it seems kinda impossible for me to nest the function within the countif formula itself.
=COUNTIF((GETLASTWSNAME())!A2:A7,"Apple)
The above formula is how i want my formula to work, but sadly excel does not allow me to do that.
Any comments would be appreciated. Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…