If formula

MrSupreme

New Member
Joined
Jul 2, 2019
Messages
6
Hi All

Hopefully someone could help with my issue here. I am trying to create a formula which will return the correct value based on a certain criteria. Essentially, I have a list of areas (column D) and I want the formula in column C to fill in the correct unit type (column G) based on certain rules. The first if formula works fine and commands that any unit which is less than 538 should return a value of IB1P. However, when I add the second if formula which includes OR, the formula no longer works and returns an error. Would appreciate any help on this please.

1695412362820.png
 

Attachments

  • 1695411470539.png
    1695411470539.png
    69.1 KB · Views: 4
  • 1695412332010.png
    1695412332010.png
    51 KB · Views: 4

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
When you nest IF statements inside of one another, the you put the second IF within the TRUE or FALSE argument, not after it (that does nothing).
So I think your second IF should be imbedded where the first "" is, and then you need another ")" at the very end.

(I would've edited your formula for you, but you posted it as an image, and I cannot copy and edit an image!)
 
Upvote 0
Solution
See if one of these formulas works for you.
Formula in column B will return Unit less than or equal to Sq. Ft. in column H.
Formula in column C will return Unit that is less than Sq. Ft. in column H.

Book2
ABCDEFGH
1
2
3
4Less than or = to HLess than HArea
5IBIPIBIP487Mimum Space Standards
62B3P2B3P663Unit typeSq. ft
72B3P2B3P672IBIP420
82B3P2B3P7171B2P538
92B3P2B3P6772B3P657
102B3P2B3P6682 B4 p753
11IBIPIBIP447
12IBIPIBIP452
132B3P1B2P657
14
Sheet1
Cell Formulas
RangeFormula
B5:B13B5=LOOKUP(D5,$H$7:$H$10,$G$7:$G$10)
C5:C13C5=LOOKUP(D5,$H$7:$H$10+1,$G$7:$G$10)
 
Upvote 0
Would this fix your current formula?
=IF(D5<$H$8,$G$7,IF(OR(D5>=$H$8,D5<$H$9),$G$8,""))
 
Upvote 0
When you nest IF statements inside of one another, the you put the second IF within the TRUE or FALSE argument, not after it (that does nothing).
So I think your second IF should be imbedded where the first "" is, and then you need another ")" at the very end.

(I would've edited your formula for you, but you posted it as an image, and I cannot copy and edit an image!)
First time using XL2BB function so hopefully you can now open in excel?

Book1
BCDEFGHIJ
2
3TypeAreaUnit TypeSq ft
41B1P4871B1P420
51B1P6631B2P538
61B1P6722B3P657
71B1P717
81B1P677
91B1P668
101B1P447
111B1P452
121B1P253
131B1P677
141B1P668
15
16
Sheet1
Cell Formulas
RangeFormula
C4:C14C4=IF(D4<$H$5,$G$4,IF(OR(C4>=$H$5,C4<$H$6),$G$5,IF(C4>=$H$6,G6,"")))
 
Upvote 0
is there a particular reason you cannot use INDEX/MATCH functionality (Or XLOOKUP - if you use 365).
Mr excel questions 63.xlsm
ABCDEFGHI
1
2
3
4Index/MatchTypeArea
51B1P1B1P487
62B3P0663Unit TypeSq ft
72B3P06721B1P420
82B3P07171B2P538
92B3P06772B3P657
102B3P0668
111B1P1B1P447
121B1P1B1P452
13Too Low1B1P253
142B3P0677
152B3P0668
MrSupreme
Cell Formulas
RangeFormula
B5:B15B5=IFERROR(INDEX($G$7:$G$9,MATCH(D5,$H$7:$H$9)),"Too Low")
C5C5=IF(D5<$H$8,$G$7,IF(OR(C5>=$H$8,C5<$H$9),$G$8,IF(C5>=$H$9,G9,"")))
C6:C8C6=IF(D6<$H$8,$G$7,IF(OR(C6>=$H$8,C6<$H$9),$G$8,IF(C6>=$H$9,#REF!,"")))
C9:C15C9=IF(D9<$H$8,$G$7,IF(OR(C9>=$H$8,C9<$H$9),$G$8,IF(C9>=$H$9,G10,"")))
 
Upvote 0
thank you all very much, the solution was ensuring the second if function is embedded with the preceding true or false argument
 
Upvote 0
You are welcome.
Glad we were able to help!
 
Upvote 0

Forum statistics

Threads
1,215,259
Messages
6,123,922
Members
449,135
Latest member
NickWBA

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