If condition meet

maabbas

Board Regular
Joined
Aug 11, 2011
Messages
201
=IF(A131=Yield!A1:A1020,(Sun!B131+Sun!P131)/Sun!K131,Sun!B131/Sun!K131)

Any help, I am not getting the right calculation
 
Sorry I posted the wrong formula, please check the below formula, I tried using the CRTL SHIFT ENTER, but formula only calcuting right the first cell of range

=IF(Yield!A757:A1020=Sun!A131,Sun!B131/Sun!K131,IF(Yield!A1:A756=Sun!A131,(Sun!B131+Sun!P131)/Sun!K131,0))

A mapping like IF(Yield!A757:A1020=Sun!A131,Sun!B131/Sun!K131,... is wrong (unless there is some strange justification for it. It says:

Whenever a cell in Yield!A757:A1020 is equal to Sun!A131, do Sun!B131/Sun!K131, which is a division involving two cells, meaning that you repeatedly perform the same division. It looks like you want but not certain...
Rich (BB code):
=IF(ISNUMBER(MATCH(Sun!A131,Yield!A757:A1020,0)),
     Sun!B131/Sun!K131,
     IF(ISNUMBER(MATCH(Sun!A131,Yield!A1:A756,0)),
         Sun!B131+Sun!P131)/Sun!K131,
         0))

See also Marcelo Branco's reply.
 
Upvote 0

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
its working but only for range A1 to A756, I have more product from range A757 to A1020 where I want formula to calculate Pound produce/Raw(B131/K131).

I think it works for both ranges since accordingly with your formula in #3 if the product is located in A757:A1020 (not in A1:A756) the MATCH part returns #N/A and ISNUMBER(#N/A) returns FALSE

So the formula evaluates as

(B131 + ISNUMBER(#N/A)*P131)/K131 = (B131 + (FALSE)*P131)/K131 = (B131 + 0)/K131 = B131/K131

Isn't this what you need?

M.
 
Upvote 0
A mapping like IF(Yield!A757:A1020=Sun!A131,Sun!B131/Sun!K131,... is wrong (unless there is some strange justification for it. It says:

Whenever a cell in Yield!A757:A1020 is equal to Sun!A131, do Sun!B131/Sun!K131, which is a division involving two cells, meaning that you repeatedly perform the same division. It looks like you want but not certain...
Rich (BB code):
=IF(ISNUMBER(MATCH(Sun!A131,Yield!A757:A1020,0)),
     Sun!B131/Sun!K131,
     IF(ISNUMBER(MATCH(Sun!A131,Yield!A1:A756,0)),
         Sun!B131+Sun!P131)/Sun!K131,
         0))

See also Marcelo Branco's reply.

Sorry for delay, took some days off, so far the above formula working great, if any issue I will contact you all. Thanks for everyone.
 
Upvote 0

Forum statistics

Threads
1,216,025
Messages
6,128,354
Members
449,443
Latest member
Chrissy_M

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