IF, OR, Index, Match, Multiple Criteria

wintye

New Member
Joined
Apr 15, 2013
Messages
15
Hi All,

I hope you're enjoying the weekend.

I wonder if anyone can help with the following formula. I'm trying to pull a date from another table but only if it matches certain criteria.

Table with Data
Unique IdentifierFirst NameLast NameCourseDateGrade
12345JaneDoeCourse 115/04/20163
12345JaneDoeCourse 217/05/20173
12345JaneDoeCourse 319/01/20183
34567JohnSmithCourse 210/07/20175
34567JohnSmithCourse 325/06/20175
34567JohnSmithCourse 128/10/20165
78901JaneSmithCourse 301/01/20164
78901JaneSmithCourse 201/10/20174
78901JaneSmithCourse 101/05/20154
JohnDoeCourse 229/03/20157
JohnDoeCourse 123/10/20177
JohnDoeCourse 316/03/20167

<tbody>
</tbody>

Table pulling data into

Last NameFirst NameUnique IdentifierCourse 1Course 2Course 3
VLOOKUP from another tableVLOOKUP from another tableVLOOKUP from another tableto include the formulato include the formulato include the formula

<tbody>
</tbody>

The formula I have so far is:

{=IF(C2="","",IF(OR(Data_Report[Grade]="3",Data_Report[Grade]="4"),INDEX(Data_Report[Date],MATCH(1,(Data_Report[Unique Identifier]=C2)*(Data_Report[Course]="1"),0)),"Not Applicable"))}

Basically I'd like the formula to show if there's nothing in the "unique Identifier" column then to leave the cell empty,
If there is a "unique Identifier" in cell 'C2' then to lookup the unique identifier to the data table ensuring to match the grade to either a grade 3 or 4 and additionally match the the course name and pulling through the date the course was completed.
If the grade is different to 3 or 4 then to return 'not applicable'

e.g. = Jane Doe, Course 2 should show as '17/05/2017'
John Smith, Course 3 should show as 'Not Applicable'
Jane Smith, Course 1 should show as '01/05/2015'
John Doe, Course 1 should show as a blank cell

Hoping the above makes sense and welcome any feedback and advise. I've spen forever trying to get it to work and am so close but haven't quite got it.

Many thanks in advance for reading
Wintye :confused::confused:
****** id="cke_pastebin" style="position: absolute; top: 0px; width: 1px; height: 1px; overflow: hidden; left: -1000px;">
17/05/2017

<tbody>
</tbody>
</body>
 
Hi there, Apolgies if this is not the way to go about this but I have a variation on a similar theme that I am trying to solve. Please let me know if I should make this a separate posting.

In the following table, the full version of which is about 30k records at the moment, I am trying to sum all the sales made in the QTY column where the EVENT = "8549", and the CODE ="IB" or "CC" and if possible the CUST = "TBAT". I have a number of combos/variants on this that I will hang together once I understand the general way in which this is handled. I had thought to pivot the data first into simple total report that I then lookup into if that makes sense.

EVENTCODEQTYPRICECUSTFEE
8549CC150.75TBAT0.8
8549CC150.75TBAT0.8
8549IB150.75TBAT0.8
8549IB150.75TBAT0.8
8582IB150.75TBAT0.8
8582IB150.75TBAT0.8
8582AH150.75INGRESS0.8
8549AH150.75INGRESS0.8
8549CC150.75TBAT0.8
8549AH150.75TBAT0.8
8549AH150.75ENTA0.8
8549AH150.75ENTA0.8
8549AH150.75ENTA0.8
7711CC150.75GIGS0.8
7711CC150.75GIGS0.8

<tbody>
</tbody>
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hi there, Apolgies if this is not the way to go about this but I have a variation on a similar theme that I am trying to solve. Please let me know if I should make this a separate posting.

In the following table, the full version of which is about 30k records at the moment, I am trying to sum all the sales made in the QTY column where the EVENT = "8549", and the CODE ="IB" or "CC" and if possible the CUST = "TBAT". I have a number of combos/variants on this that I will hang together once I understand the general way in which this is handled. I had thought to pivot the data first into simple total report that I then lookup into if that makes sense.

Try this in K2:

=SUMPRODUCT(SUMIFS(C:C,A:A,H2,B:B,I2:I3,E:E,J2))


ABCDEFGHIJK
1EVENTCODEQTYPRICECUSTFEEEVENTCODECUSTQTY
28549CC150.75TBAT0.88549IBTBAT5
38549CC150.75TBAT0.8CC
48549IB150.75TBAT0.8
58549IB150.75TBAT0.8
68582IB150.75TBAT0.8
78582IB150.75TBAT0.8
88582AH150.75INGRESS0.8
98549AH150.75INGRESS0.8
108549CC150.75TBAT0.8
118549AH150.75TBAT0.8
128549AH150.75ENTA0.8
138549AH150.75ENTA0.8
148549AH150.75ENTA0.8
157711CC150.75GIGS0.8
167711CC150.75GIGS0.8
17
*******************************************************************************

<tbody>
</tbody>

Markmzz
 
Upvote 0
Thanks Mark, i'll try that - for this to work, do the column headings have to be there in columns H,I & J or does it just use the actual data content in H2, I2:I3 and J2 for the maths to work ?

I had got somewhere similar using a DSUM function but I felt that that needed far too many criteria tables for me to then report on each event in the range I need to report on - I have 50 events in total from which I want to derive sums.

Doing it you way will greatly limit the criteria sections that I have to create which is great. Basically I can just use your basic sum and change the Event criteria field only each time for me to get what I need.
 
Upvote 0
Hi Mark, No need to respond to my previous submission i've worked its out and event better I can hard code one or two of the pre-reqs into the formula you gave me and then it can actually use the cell address of the event from the table in which I am going to store the results making the whole pretty much a copyable solution rather than a function that required me to edit multiple times - thanks for your steering on this - much appreciated.
 
Upvote 0
Hi Mark, No need to respond to my previous submission i've worked its out and event better I can hard code one or two of the pre-reqs into the formula you gave me and then it can actually use the cell address of the event from the table in which I am going to store the results making the whole pretty much a copyable solution rather than a function that required me to edit multiple times - thanks for your steering on this - much appreciated.

I'm glad to help and thanks for the feedback.

Markmzz
 
Upvote 0
Hello I am looking to pull the closest price of a particular serial no.

The criteria being the serial no. The value returned needs to be the closest value (absolute).

Serial No.Average
00163UAD8105.125
00163UAD8104.625Criteria
00163UAD8104.6271136Serial No.00163UAD8
00163UAA4107.875Average Bid & Ask103.68
00163UAA4115.065
00163UAA4113.38Output
00163UAA4104.85Average of Bid & Ask
00163UAD8105.0255
00163UAD8104.5953352
00163UAD8104.9375

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

Serial No.Average
00163UAD8105.125
00163UAD8104.625Criteria
00163UAD8104.6271136Serial No.00163UAD8
00163UAA4107.875Average Bid & Ask103.68
00163UAA4115.065
00163UAA4113.38Output
00163UAA4104.85Average of Bid & Ask
00163UAD8105.0255
00163UAD8104.5953352
00163UAD8104.9375
00163UAD8104.8125
00163UAD8104.1696
00163UAD8105.755
00163UAD8104.615
00163UAD8104.87
00163UAA4107.69
00163UAA4110.1549026
00163UAA4112.125
00163UAA4105.2696711

<tbody>
</tbody><colgroup><col><col><col><col><col></colgroup>
 
Upvote 0

Forum statistics

Threads
1,215,035
Messages
6,122,791
Members
449,095
Latest member
m_smith_solihull

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