Formula help

Alex D

New Member
Joined
Apr 28, 2020
Messages
48
Office Version
  1. 365
Platform
  1. Windows
Trying to write a formula, but having a really hard time. I want to do the following...

If the first cell says, Commercial, then I want it to look at the second cell (# there now is 32) and if that value is less than 30, give me a 1 if not a 0, and if the first cell is NOT commercial, then look at 3rd cell (# there now is 29) and if that value is less than 30 give me a 1 if not a 0. on top of this, i want an iferror to show me blank.....

Commercial
32​
29​
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
i want an iferror to show me blank
Idk what this means, if the cell is blank you want to show blank?
Excel Formula:
=IF(A2<>"",IF(A2="Commercial",IF(B2<30,1,0),IF(C2<30,1,0)),"")
 
Upvote 0
Idk what this means, if the cell is blank you want to show blank?
Excel Formula:
=IF(A2<>"",IF(A2="Commercial",IF(B2<30,1,0),IF(C2<30,1,0)),"")

I want a blank, if the formula produces an error...the first cell will ALWAYS be either COMMERCIAL or something else, never ever blank.
 
Upvote 0
I want a blank, if the formula produces an error...the first cell will ALWAYS be either COMMERCIAL or something else, never ever blank.
The one which is given by shinigamilight does the same !
 
Upvote 0
Excel Formula:
=IFERROR(IF(A2="Commercial",IF(B2<30,1,0),IF(C2<30,1,0)),"")

I just thought of something else, as I put that formula on my sheet, something else came up.....so this formula you gave me is perfect, thank you, but how do I get a "blank" result if either B2 and or C2 is blank?
 
Upvote 0
See if this helps

Excel Formula:
=IFERROR(IF(A2="Commercial",IF(OR(B2="",C2=""),"",IF(B2<30,1,0)),IF(C2<30,1,0)),"")
 
Upvote 0
See if this helps

Excel Formula:
=IFERROR(IF(A2="Commercial",IF(OR(B2="",C2=""),"",IF(B2<30,1,0)),IF(C2<30,1,0)),"")

Appreciate the reply, but it didn't solve for what I am trying to do.
 
Upvote 0
Appreciate the reply, but it didn't solve for what I am trying to do.
Here is what I am after.....

First cell says: Commercial or Residential (never blank)
Second cell is a #, let's pretend it is 32
Third cell is a #, let's pretend it is 25

I want my formula, to look up the first cell, and if it's Commercial, go to the second cell, and if that value is less than 30, then give me a 1, if not a 0, but also look to see if second cell is blank, and if so, return the blank

If the first cell is not commercial, go to the third cell and if that value is less than 30, then give me a 1, if not a 0, but also look to see if third cell is blank, and if so, return the blank
 
Upvote 0
Cross-posting (posting the same question in more than one forum) is not against our rules, but the method of doing so is covered by #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

Cross posted at: Formula Help.....
There is no need to repeat the link(s) provided above but if you have posted the question at other places, please provide links to those as well.

If you do cross-post in the future and also provide links, then there shouldn’t be a problem.
 
Upvote 0

Forum statistics

Threads
1,214,998
Messages
6,122,638
Members
449,093
Latest member
Ahmad123098

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