What do I use? Index? Match? If? Combination of all three?

justincaza

New Member
Joined
Dec 15, 2017
Messages
9
Good afternoon,
I have a workbook. Within that workbook I have two worksheets, one is called customer list and the second is called raw data. The raw data worksheet is set up like below...

Atlantic Coast ZoneF2F3F4F5F6F7F8
BranchCustomer NameConsignment ModelQ1Q2
Q1 StartQ1 EndQ2 Start
9/3/201712/2/201712/3/2017
Date CompletedStatusDate Completed
AUG58OmittedOmittedUsageOut of Compliance
GRV178OmittedOmittedUsage10/26/17Completed
AUG188OmittedOmittedUsageOut of Compliance
CHS324OmittedOmittedUsage10/4/17Completed
CHS330OmittedOmittedUsage10/26/17Completed
AUG375OmittedOmittedUsageOut of Compliance
BranchCustomer NameConsignment ModelQ1 - Q2
Q1 StartQ2 End
9/3/20173/3/2018
Date CompletedStatus
CHS138OmittedOmittedReplenishmentCount Required
GRV218OmittedOmittedReplenishmentCount Required
CHS340OmittedOmittedReplenishmentCount Required
AUG422OmittedOmittedReplenishmentCount Required
GRV424OmittedOmittedReplenishmentCount Required

<colgroup><col width="129" style="width:97pt"> <col width="31" style="width:23pt"> <col width="63" style="width:47pt"> <col width="254" style="width:191pt"> <col width="130" style="width:98pt"> <col width="108" style="width:81pt"> <col width="123" style="width:92pt"> <col width="108" style="width:81pt"> </colgroup><tbody>
</tbody>

The customer list work sheet is setup like below...

ISS Cust #AS 400#Customer NameAccount TypeConsignment ModelBranchZoneInventory ValueQ1Q2Q3Q4
47OmittedOmittedCAPReplenishmentGPDGreat LakesOmitted
48OmittedOmittedCAPReplenishmentGPDGreat LakesOmitted
49OmittedOmittedCAPReplenishmentGPDGreat LakesOmitted
50OmittedOmittedCAPUsageGPDGreat LakesOmitted
58OmittedOmittedShelf/SAPUsageAUGAtlantic CoastOmitted
59OmittedOmittedShelf/SAPUsageLTRHeartlandOmitted
60OmittedOmittedCAPReplenishmentJISSoutheast CentralOmitted
73OmittedOmittedCAPUsageGPDGreat LakesOmitted

<colgroup><col width="74" style="width:56pt"> <col width="63" style="width:47pt"> <col width="302" style="width:227pt"> <col width="93" style="width:70pt"> <col width="130" style="width:98pt"> <col width="50" style="width:38pt"> <col width="115" style="width:86pt"> <col width="104" style="width:78pt"> <col width="27" style="width:20pt" span="4"> </colgroup><tbody>
</tbody>

This is what I'm trying to accomplish...In the Q1 column on the customer list, I need the value that is in column F7 OR F8 from the raw data worksheet where the ISS customer number in the customer list matches the customer number in the raw data in column F2. Both sheets are setup as tables. As you can see the value I'm looking for can either be in column F7 OR column F8. I've been researching for a couple days and I cannot figure this out. Can someone please help me figure out what this formula would be and understand it.
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
HI,

Does it matter if both "F7" and "F8" have data in them? Is there a preference on which one to return over the other? Try the below to prefer "F7" over "F8" (I'm using actual column letters in the formula too btw)

Code:
=IF(ISBLANK(INDEX(RAW!G:G,MATCH(A2,RAW!B:B,0))),INDEX(RAW!H:H,MATCH(A2,RAW!B:B,0)),INDEX(RAW!G:G,MATCH(A2,RAW!B:B,0)))

Of course you could return both through a concatenation:

Code:
=INDEX(RAW!G:G,MATCH(A2,RAW!B:B,0))&" / "&INDEX(RAW!H:H,MATCH(A2,RAW!B:B,0))
 
Last edited:
Upvote 0
HI,

Does it matter if both "F7" and "F8" have data in them? Is there a preference on which one to return over the other? Try the below to prefer "F7" over "F8" (I'm using actual column letters in the formula too btw)

Code:
=IF(ISBLANK(INDEX(RAW!G:G,MATCH(A2,RAW!B:B,0))),INDEX(RAW!H:H,MATCH(A2,RAW!B:B,0)),INDEX(RAW!G:G,MATCH(A2,RAW!B:B,0)))

Of course you could return both through a concatenation:

Code:
=INDEX(RAW!G:G,MATCH(A2,RAW!B:B,0))&" / "&INDEX(RAW!H:H,MATCH(A2,RAW!B:B,0))


The value I need to return can either be in column F7 OR in column F8. The determining factor would be based in column F2 and F5. If column F2 has a number AND column F5 has "usage" then I need what is in column F7 returned in the customer list sheet. If column F2 has a number AND column F5 has "replenishment" then I need what is in column F8 returned in the customer sheet. I'm hoping I can just copy down the formula.
 
Upvote 0
Give this a try. It considers the "Usage"/"Replenishment" requirement. If there is something other than "Usage" or "Replenishment" in that column it will return a blank cell. It's also assuming that any customer number listed will be in the RAW Data sheet. If it is not then it will return an error.

Code:
=IF(E2="Usage",INDEX('raw data'!G:G,MATCH(A2,'raw data'!B:B,0)),IF(E2="Replenishment",INDEX('raw data'!H:H,MATCH(A2,'raw data'!B:B,0)),""))
 
Upvote 0
Works perfect, thank you! I've been trying to get this down for a couple of days now. I typed out the code to help me understand where I went wrong and found it, so thank you for helping me.
 
Upvote 0

Forum statistics

Threads
1,214,839
Messages
6,121,887
Members
449,057
Latest member
Moo4247

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