IF statement help needed!

iouu2

New Member
Joined
Apr 15, 2011
Messages
14
hello i am a little :eeek: about excel IF statements.
basically what i want to do is make sure the intended users of a form, fill it out in WHOLE (completely).

the IF statement/rule is that both the project # (B21) and unit price (U21) need to be populated for the total price (V21) to show value.

keep in mind i have a IF statement in V21 (total price).

CLicking on the link below is a example of what I am referring to. I need to make sure the code applies to each line item!

http://img821.imageshack.us/f/examplelj.png/

Thanks for the help/advice!
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Where would I paste that formula? The cells that are highlighted BLUE also have a drop down list with specific project numbers.

I tried pasting it in TOTAL PRICE but there is a formula there. :(
 
Upvote 0
Welcome to the Board!

If you follow the link in my sig you'll be able to post an actual screen shot we can use.

What formula do you have in V21 now?

Here's a basic formula that might get you started:

=IF(OR(B21="",U21=""),"Oops","OK")

HTH,
 
Upvote 0
In the formula VoG gave you, I believe he intended it to go in V21 (TOTAL PRICE), but also assumed that you wanted V21 to add B21 and U21.

=IF(OR(B21="",U21=""),"",B21+U21)

Instead, change the bolded part to the formula currently in V21

=IF(OR(B21="",U21=""),"",YourFormulaHere)

*Don't copy in the = with your formula. This is wrong:
=IF(OR(B21="",U21=""),"",=YourFormulaHere)

Now V21 says:

If B21 or U21 is blank, display a blank cell. Otherwise, perform the Total Price formula.

Hope this helps!
 
Upvote 0
Thanks for the suggestion.
Its a complicated EXCEL sheet. :confused:
Its a purchase request form we fill out but we want users to fill majority of the sheet before printing it off and handing it over.
I figured using a MACRO would be best but there will be user resistance (having to enable macro's).
Also, I clicked on the link in your sig, did you want to see the actual file? ;)


This is the code in V21.
=IF(AND(T21="",U21=""),"",IF(AND(T21=0,U21<>""),U21,T21*U21))
 
Upvote 0
:crash: So its not working with this formula I have put in. :crash:

Formula currently in V21: =IF(AND(T21="",U21=""),"",IF(AND(T21=0,U21<>""),U21,T21*U21))


You said to take this route.
=IF(OR(B21="",U21=""),"",YourFormulaHere)
So I entered this formula in V21 and its causing errors. :mad:

=IF(OR(B21="",U21=""),"",(AND(T21="",U21=""),"",IF(AND(T21=0,U21<>""),U21,T21*U21))<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
 
Upvote 0
Try

=IF(OR(B21="",U21=""),"",IF(AND(T21="",U21=""),"",IF(AND(T21=0,U21<>""),U21,T21*U21)))
 
Last edited:
Upvote 0
I think you left out an IF in yours:

=IF(OR(B21="",U21=""),"",(AND(T21="",U21=""),"",IF(AND(T21=0,U21<>""),U21,T21*U21))<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>

Try:

=IF(OR(B21="",U21=""),"",IF(AND(T21="",U21=""),"",IF(AND(T21=0,U21<>""),U21,T21*U21)) )
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,711
Members
452,939
Latest member
WCrawford

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