IF and VLOOKUP formulas to get started

Pottie8

New Member
Joined
Jun 1, 2017
Messages
42
Hi All

I hope to receive as much guidance and help as possible on this platform :)

https://drive.google.com/drive/folders/0B9pqW92R9U4xLWkxek1zTGFZLUk?usp=sharing

I have attached the data and destination images and would just like so help with formulas to:

1. In destination enter user name just the first time even if it is in data more than once.
2. continue on the second line with the first instance of any different name etc.
3. populate column values based on data sheet.

If any further info is needed, please let me know.


Regards,
Pottie8
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
I would sort the data by student name ascending, then by exam name ascending, then by fail before pass.

I would then use a macro to pull out scores to find number of attempts, ave and best score etc. Easy, but quite time consuming. I am away for 4 days if nobody else has sorted it for you by then I will try to do it for you.
 
Upvote 0
I would sort the data by student name ascending, then by exam name ascending, then by fail before pass.

I would then use a macro to pull out scores to find number of attempts, ave and best score etc. Easy, but quite time consuming. I am away for 4 days if nobody else has sorted it for you by then I will try to do it for you.

Hi There,

That sound great! Thank you in advance!


Kind Regards,
Henco
 
Upvote 0
Hi Pottie8,

please check out my try to your request:

Firstly, for the sake of simplicity I have named the columns in the data sheet as follows: dates, students, lessons, results.
Secondly, 'name' is the reference to the student name you type in, so basically A4, A5, etc and 'lesson' is the reference to the lesson (so likely B2 or you can hardcode it). Obviously your final references need appropriate update to match your sheet names etc.

# For the number of attempts:
=COUNTIFS(students,name,lessons,lesson)

# For the best score:
=MAXIFS(results,students,name,lessons,lesson)

# For the average:
=AVERAGEIFS(results,students,name,lessons,lesson)

# And for the initial score:
=INDIRECT(ADDRESS(ROW(dates)+MATCH(MINIFS(dates,students,name,lessons,lesson),dates,0)-1,COLUMN(results)))

I hope you find it at least somehow helpful.
 
Upvote 0
Hi Pottie8,

please check out my try to your request:

Firstly, for the sake of simplicity I have named the columns in the data sheet as follows: dates, students, lessons, results.
Secondly, 'name' is the reference to the student name you type in, so basically A4, A5, etc and 'lesson' is the reference to the lesson (so likely B2 or you can hardcode it). Obviously your final references need appropriate update to match your sheet names etc.

# For the number of attempts:
=COUNTIFS(students,name,lessons,lesson)

# For the best score:
=MAXIFS(results,students,name,lessons,lesson)

# For the average:
=AVERAGEIFS(results,students,name,lessons,lesson)

# And for the initial score:
=INDIRECT(ADDRESS(ROW(dates)+MATCH(MINIFS(dates,students,name,lessons,lesson),dates,0)-1,COLUMN(results)))

I hope you find it at least somehow helpful.



Hi micsza

That seems to do the trick! :)

Just playing around with the specifics, but thatnk you ever so much!!!!!

Please be on standby furhter if possible?

THANK YOU!!!


Pottie8
 
Upvote 0
Hi There

I seem to just be struggling with initial score issue. The rest works 100%! Thank you.


WORKSHEET:

ABCDEFGH
1StoredatesTimeTotal TimestudentslessonsresultsPassed
2AAA2017-04-0712:18:2900:01:11JohnLesson 1 : Part 1600
3AAA2017-04-0718:08:2005:48:43JohnLesson 1 : Part 1600
4AAA2017-04-1316:00:4900:01:26JohnLesson 1 : Part 1801
5AAA2017-04-2812:17:3200:01:47JohnLesson 1 : Part 1600
6AAA2017-04-2812:18:4700:01:06MaryLesson 1 : Part 1801
7AAA2017-04-1210:50:1300:01:29JohnLesson 1 : Part 1600
8AAA2017-04-0517:11:1100:01:30LukeLesson 1 : Part 1801
9AAA2017-04-2815:04:2500:01:15JamesLesson 1 : Part 11001
10AAA2017-04-0515:44:1800:02:56JamesLesson 1 : Part 1600
11AAA2017-04-0515:49:2900:05:05LukeLesson 1 : Part 1801
12AAA2017-04-0515:50:1300:00:33MaryLesson 1 : Part 1600
13AAA2017-04-0515:50:5100:00:34MaryLesson 1 : Part 1600
14AAA2017-04-0515:51:2600:00:31JohnLesson 1 : Part 1801
15AAA2017-04-0515:53:1100:01:42LukeLesson 1 : Part 1801
16AAA2017-04-0515:53:3700:00:20LukeLesson 1 : Part 1600
17AAA2017-04-0515:54:4500:01:04LukeLesson 1 : Part 1801
18AAA2017-04-0515:55:1800:00:27LukeLesson 1 : Part 1600
19AAA2017-04-0515:55:4100:00:20LukeLesson 1 : Part 1600
20AAA2017-04-0516:00:4200:04:59MaryLesson 1 : Part 11001
21AAA2017-04-1210:35:3000:00:58JamesLesson 1 : Part 1400
22AAA2017-04-1210:36:0000:00:27LukeLesson 1 : Part 1801
23AAA2017-04-2612:07:2600:02:03JohnLesson 1 : Part 1600
24AAA2017-04-0712:27:0100:01:26JamesLesson 1 : Part 1801
25AAA2017-04-2814:16:4000:01:25PaulLesson 1 : Part 1400
26AAA2017-04-2814:17:5600:01:12PaulLesson 1 : Part 1600
27AAA2017-04-2814:19:1700:01:00JohnLesson 1 : Part 1801
28AAA2017-04-2909:38:2119:18:54PaulLesson 1 : Part 11001
29AAA2017-04-0712:31:2600:02:13LukeLesson 1 : Part 1400
30AAA2017-04-2515:51:4903:14:05PeterLesson 1 : Part 1600

<colgroup><col><col><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>


Results:

ABCDE
1
2
3
4
5NameInitial ScoreAttemptsAverageBest Score
6John56880
7Mary16060
8Luke290100
9James1468100
10Paul18080
11Peter470100
12Melissa55660
13Fred27080

<colgroup><col span="2"><col><col><col><col></colgroup><tbody>
</tbody>


Results Sheet in column B (initial score - B6 onwards) should reflect the students initial score based on date and then also time (the FIRST time student completed given lesson)

Please could you assist :)


Pottie8*
 
Upvote 0
To get the Initial Score try (array formula)

B6
=INDEX(results,MATCH(1,IF(students=A6,IF(dates+Time=MIN(IF(students=A6,dates+Time)),1)),0))
Ctrl+Shift+Enter

If you are using Excel 2016 (office 365) you can substitute MIN(IF(...)) by MINIFS(...)

M.
 
Upvote 0
Hi there! Thank you - I have got a feeling you know exactly, but it gives me an N/A error. Do you think it could be because of date and/or time columns?
 
Upvote 0
Check if they are numbers, not text. Use =ISNUMBER(B2) and ISNUMBER(C2) in empty columns and copy down (should return True, if numbers)

I tried with your data sample above and the formula worked perfectly for me.
I've gotten #N/D (#N/A in Engllish) only for Melissa and Fred because they are not present in your data sample of Worksheet.


A
B
C
D
E
5
Name​
Initial Score​
Attempts​
Average​
Best Score​
6
John​
80​
5​
68​
80
7
Mary​
60​
1​
60​
60​
8
Luke​
80​
2​
90​
100​
9
James​
60​
14​
68​
100​
10
Paul​
40​
1​
80​
80​
11
Peter​
60​
4​
70​
100​
12
Melissa​
#N/D​
5​
56​
60​
13
Fred​
#N/D​
2​
70​
80​

<tbody>
</tbody>

Have you confirmed the formula with Ctrl+Shift+Enter?

M.
 
Last edited:
Upvote 0
Hi There

It is not numbers, it was text, but formatting it as dates (which it is) return same result. Only once retyped it returns TRUE.

Also, even with this change, I still get error #N/A. but let me look into this as you are able to test with positive results, and see what I come up with.

Thank you for all your input!
 
Upvote 0

Forum statistics

Threads
1,215,509
Messages
6,125,216
Members
449,215
Latest member
texmansru47

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top