logical formula without using =IF

Hammerjoe

Board Regular
Joined
Feb 4, 2012
Messages
76
I am trying to create a formula in excel 2007 without using =IF and I am struggling to come up with a solution.

Cell A1 is the input cell and cell b1 is another input cell.

I am creating a table from A5 to a50 starting with A5=1

The formula I am looking for in row B1:B50 is equal to cell A if cell A<=$A$1 and if($b$1=2) otherwise it equals zero.

I got the formula below but I would like to simplify it without using the IF condition:

IF(A5<=$A$1,A5,IF($b$1=2,0,A5))


Thank you
 
I do not know why you do not want to use the IF function.
Although it's more complicated, in my opinion, see if this does what you want

=A5*((A5<=A$1)+(A5>A$1)*(B$1<>2))

M.

Your formula works. Thank you for the help.

This is part of an already long formula in my sheet and wanted to keep it as simple as possible because it does alot of checks like that.
 
Upvote 0

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Try

=OR(A5<$A$1,$B$1<>2)*A5
Originally I was going to give the OP that formula, but then figured if he did not want to use simple IF function calls, he probably was looking to remove all function calls. Your formula is identical to mine except that I add the two logical expressions together instead of using the equivalent OR function on them.
 
Upvote 0
Originally I was going to give the OP that formula, but then figured if he did not want to use simple IF function calls, he probably was looking to remove all function calls. Your formula is identical to mine except that I add the two logical expressions together instead of using the equivalent OR function on them.

Rick,

It seems your formula (post 8) returns 2*A5 when both conditions are met.

M.
 
Upvote 0
According to the formula of post 1
IF(A5<=$A$1,A5,IF($b$1=2,0,A5))

i think it should be
=A5*((A5<=$A$1)+($B$1<>2)>0)
Sloppy editing on my part. :banghead: Of course, my question from Message #7 has not been addressed by the OP yet (hmm, I just noticed I have been omitting the equal sign part of the comparison for quite some time now:sad:).
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,825
Messages
6,181,190
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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