Return value based on multiple conditions

jctroxell

New Member
Joined
Nov 26, 2014
Messages
4
More information
I am trying to have a cell return a value based on multiple conditions. From the table below:

ABCD
1ProjectOriginDestinationmiles
2Alphawashingtoncalifornia1500
3Alphamichigancalifornia1000
4Alphaatlantaohio750
5Alphachicagoohio356
6Bravonashvillepennsylvania2000
7Bravoalabamapennsylvania590
8Bravofloridageorgia875
9Bravotexasgeorgia250

<tbody>
</tbody>

I want to have a cell (in another sheet) return the mileage by simply inputting the Project name, origin and destination.

So, the formula should first narrow to the matching project in A2 below, then match the origin in B2 below, then match the destination in C2 below and then return the corresponding mileage in D2 below. What formula do I need to put into D2??

ABCD
1projectorigindestinationmiles
2AlphaMichiganCaliforniaRETURNED MILEAGE

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


Help!
 
Last edited:

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Welcome to the board.

You could do
=SUMPRODUCT(--(A1:A9="Alpha"),--(B1:B9="Washington"),--(C1:C9="california"),D1:D9)
 
Upvote 0
Not quite what O was looking for, let me try explaining again:

if I have a sheet called projects:

ABCD
1Project NameOrigineDestinationMiles
2AlphaChicagoNewyork510
3AlphaChicagoNewyork510
4AlphaChicagoAtlanta940
5AlphaChicagoAtlanta940
6AlphaBostonNewyork120
7AlphaBostonNewyork120
8AlphaBostonAtlanta610
9AlphaBostonAtlanta610
10BravoDetroitSand Diego250
11BravoDetroitSand Diego250
12BravoBostonNebraska750
13BravoBostonNebraska750
14BravoHoustonAtlanta350
15BravoHoustonAtlanta350

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

And then If I have another sheet called analysis:

ABCD
1Project nameOrigineDestinationMiles
2"enter project name""Enter Origine""Enter Destinaiton""=miles"

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


I want 'analysis'!D2 to return:

D2= Find all matching 'analysis'!D2 in range 'projects'!A2:A9999999, then of that selection find all matching 'analysis'!B2 in range 'projects'!B2:B99999, then of that selection find all matching 'analysis'!C2 in range 'projects'!C2:C9999, and finally of that selection return the value of 'projects'!D2:D9999

The issue is, as you'll see in the table above, I could have all of the criteria match up multiple times, however I want a product or a sum of all of the miles, I simply want what the mileage is from origin to destination.

Example

Analysis:

ABCD
1Project nameOrigineDestinationMiles
2AlphaChcagoNewyork510

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


Rather than:

ABCD
1Project nameOrigineDestinationMiles
2AlphaChcagoNewyork1020 or 260100

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


Please help!
 
Upvote 0

Forum statistics

Threads
1,214,978
Messages
6,122,545
Members
449,089
Latest member
davidcom

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