# How to shorten If formula?

1. ## How to shorten If formula?

Hi,

Please help me to shorten this formula. I think to use Or function here but confused. The cell reference F5 on sheet1 is static/unchanged so I want to avoide its repeated use in formula. It increases the length of the formula.

``Please Login or Register  to view this content.``
Any help will be appreciated.

Thanking you.

2. ## Re: How to shorten If formula?

It looks like you are only looking for 2 choices from F5 (apart from H8/J8 being blank), so maybe this...
=IF(OR(Sheet1!H8="",J8=""),"",IF(Sheet1!\$F\$5="Std. 9 A",Sheet1!H8,Sheet1!J8))

If you are testing to see if either are blank, then the above will work

Another option (you will need to test this) would be...
=IF(Sheet1!\$F\$5="Std. 9 A",Sheet1!H8,Sheet1!J8)
If H8 is blank, thats the answer you will get, if the criteria is met

3. ## Re: How to shorten If formula?

Not sure of the syntax you're using there but if these are all the possible combinations I'd be tempted to do something like this

``Please Login or Register  to view this content.``

4. ## Re: How to shorten If formula?

Hi Fort,
Thank you. The second formula is working fine as per my requirement.

Thank you.

5. ## Re: How to shorten If formula?

you'r welcome. If this answered your question, please take a moment to mark the thread as "solved" - it helps keep things neat and tidy lol, and consider adding the reputation to those that helped (see points 2 & 3 below my 1st post to you)

6. ## Re: How to shorten If formula?

Hi Crooza,
Thank you. It's also working fine as per my requirement.

Thank you and have a nice day.

There are currently 1 users browsing this thread. (0 members and 1 guests)