Multiple matches using the IF function

JRRT

New Member
Joined
Mar 19, 2002
Messages
21
The formula I am using will be in F2 I want to have it look at what is in cells A24 through A28 to find the match that is in E2 then multiply it by what is in d2 by what it finds on the match that is the right of the search that it did on A24 through A28 which is in the D24 through D28.
I know this is confusing if you need more of an explination let me know.
I have come up with part of what I need but can't figure how to get the last multiplication part. here is what I have so far: =($A$23:$A$28=E2)*D2*D24. Thanks for your help this site is amazing!
 
On 2002-03-21 14:33, JRRT wrote:
With both formulas it still comes up with the answer 2401.60 but the answer is supposed to be 2370. I can't seem to find why it is doing it wrong. I tried both formulas and both give the incorrect answer of 2401.60 any ideas why?

Could you post what is in A24:A28, D24:D28, D2, and E2?

Aladin
 
Upvote 0

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Here it is Thanks.

A24:A28 has the following:
Pioneer 33R87
Pioneer 3237
Pioneer 3436
Pioneer 33P66
empty


D24:D28 has the following
85.00
89
80
79
0

D2 has the number 30

E2 has Pioneer 33P66
 
Upvote 0
On 2002-03-21 15:23, JRRT wrote:
Here it is Thanks.

A24:A28 has the following:
Pioneer 33R87
Pioneer 3237
Pioneer 3436
Pioneer 33P66
empty


D24:D28 has the following
85.00
89
80
79
0

D2 has the number 30

E2 has Pioneer 33P66

I get 2370!

It seems you're retrieving the wrong number from the D-range.

Aladin

Try to re-enter the formula I suggested lierally.
 
Upvote 0
Your list is not in ascending order.

Use =VLOOKUP(E2,A24:D28,4,FALSE)*D2
 
Upvote 0
On 2002-03-21 15:39, Dave Patton wrote:

Your list is not in ascending order.

Use =VLOOKUP(E2,A24:D28,4,FALSE)*D2

Dave,

I'm using MATCH(...,0) as part of the formula. So, that should be OK, and it's OK.

Aladin
 
Upvote 0
On 2002-03-21 15:39, Dave Patton wrote:

Your list is not in ascending order.

Use =VLOOKUP(E2,A24:D28,4,FALSE)*D2

Nor does it need be. From the help file:

"If range_lookup is TRUE, the values in the first column of table_array must be placed in ascending order: ..., -2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE; otherwise VLOOKUP may not give the correct value. If range_lookup is FALSE, table_array does not need to be sorted."

Is it possible your D2 value is really 30.43797 and you are just showing the first two places????
This message was edited by IML on 2002-03-21 16:56
 
Upvote 0
I think I figured out the problem. In cell D2 the number that is there which in this case is 30 but the cell gets the number by using the following formula:
=IF(B2="i",C2/2.5,IF(B2="d",C2/4,0))
When I take the formula out and just type the number 30 in cell D2 the correct answer of 2,370 appears in cell F2 like its supposed to. How can I keep the formula in cell D2 and F2? Thanks
 
Upvote 0
The formula that I suggested gives the correct answer.

Please read the Help that you quoted.

Other answers are certainly possible; I
did not state that the formula presented was the only answer.
 
Upvote 0
On 2002-03-21 16:57, JRRT wrote:
I think I figured out the problem. In cell D2 the number that is there which in this case is 30 but the cell gets the number by using the following formula:
=IF(B2="i",C2/2.5,IF(B2="d",C2/4,0))
When I take the formula out and just type the number 30 in cell D2 the correct answer of 2,370 appears in cell F2 like its supposed to. How can I keep the formula in cell D2 and F2? Thanks


you could simply round D2 (*round(d2,0))

or check precision as displayed under Tools options calculation.
 
Upvote 0

Forum statistics

Threads
1,215,029
Messages
6,122,760
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