if funtion

Forum home » Delegate support and help forum » Microsoft Excel Training and help » IF funtion

IF funtion

resolvedResolved · Medium Priority · Version 2013

IF funtion

Hi there,

I am wanting to use the =IF function to say if a cell =numbers then true = cell*1.2, false = NA

This is because I am adding in PO amounts, but some cells aren't just a number and contain text so are coming up with #VALUE.

thus my IF function looks like

=IF(A1=number and not text, "NA", B2*A1)

what do I put in for 'numbers and not text'?

Thank you,
Siobhan

RE: IF funtion

Hi Siobhan

Thanks for getting in touch. This is easier if you use an IFERROR function. You'd put something like this:

=IFERROR(B2*A1, "NA")

If there is an issue with the multiplication, it will write "NA".

Kind regards

Gary Fenn
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
Best STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

RE: IF funtion

Hi Siobhan

You can use an additional function to deal with values that normally create an error.

This function is called iferror()

Its job is to step in if something causes the results of your formula to generate an error.

You could use it as follows:

=iferror(YOUR-IF-FORMULA),"")

replace YOUR-IF-FORMULA with your current IF formula.
The part after the comma will return an empty value if the formula runs into an error. If you would prefer to return zero just change the formula as follows:

=iferror(YOUR-IF-FORMULA),"0")

Let me know if this works for you or if you have any further questions.

Kind regards,
Andrew


 

Excel tip:

Use RANDBETWEEN to generate random numbers

There may be occassions where you need to generate random numbers in your spreadsheet. Use the RANDBETWEEN function to generate random numbers between two values that you specify.

The function looks like this:

=randbetween(LOW,HIGH)

where LOW is the lowest number you want generated; and HIGH is the highest number you want generated.

This formula will work with both positive and negative LOWs and HIGHs. Also it will only generate integer numbers unless forced to do otherwise by the following:

=randbetween(LOW*10^PRECISION,
HIGH*10^PRECISION)/(10^PRECISION).

where PRECISION represents the levels of decimal precision needed (i.e. if you need numbers with one decimal place, PRECISION would be 1; 2 for two decimal places and so on).

One final note, if the RANDBETWEEN formula does not work in your spreadsheet or returns a "#NAME" error, you need to install the Analysis Toolpak Add-In. You will need to press F2 then Enter following the installation.

View all Excel hints and tips


Server loaded in 0.08 secs.