Trying to make the following happen for a cell, lets say cell N5. Would like to accomplish the following:

If number in cell is less than or equal to zero, then enter 0 in cell, if number is greater than or equal to .001 but less than or equal to 1 enter 1. Of course if the number is not any of these properties, enter the number in that cell.

Hi pjban1114! Here's a posting tip...

When posting in a help forum please try to use a subject line that is specific to the contents of your post.

If everyone used a generic subject line like "Hello Need In Microsoft Excel" or "Excel Help" (something we see a lot!) then we wouldn't be able to tell one question from another and things would get very confusing around here.

I edited the subject line for this thread, but we'd appreciate it if you could keep that in mind for future posts.

Thanks!

DerbyDad03

Office Forum Moderator

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

Your question isn't very clear. Your said: "

...lets say cell N5...If number in cell is less than or equal to zero, then enter 0 in cell"If you are asking that N5 contain both the original number and then, based on that number, change to one of the numbers in your criteria, then that is going to take some VBA coding, i.e. a Macro.

If you are asking that N5 contain 0 or 1 or the original number based on the original number being in a different cell, then that can be done with the IF function.

Let's say your original number is in A1. You could enter this in N5:

=IF(A1<=0,0,IF(AND(A1>=0.001,A1<=1),1,A1))

Does that help?

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

The formula was what I was needing. Thank you very, very much !! How is the best way to know more about formulas, it seems Greek to me.

The Excel Help files give a pretty good description and examples of the functions, assuming you know what function to use. For example, if you begin typing a formula in the formula bar, e.g.

=IF(a pop-up will appear below the formula with the syntax for that function. If you move your mouse down to the function in that pop-up and click it, the Help file for that function will open.In addition, a Google search for a function will give you lots of hits including forum posts, examples, etc.

If you don't know what function to use, most times a Google search of what you are trying to do will work. e.g. for the question you posted in this thread, a Google search like this might lead you to a solution:

excel how to return value based on value in cellOf course, there are lots of forums like this one where you can get help.

Then there are books, websites, video tutorials, and classes at adult education centers.

Good luck!

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

Ask Your Question

Weekly Poll