Add a condition to a formula

Brew

Well-known Member
Joined
Sep 29, 2003
Messages
1,569
How do I update the following formula if AL48=00, then answer will be 08 not -02
=TEXT(AL48-2,"00")
How do I update the following formula if AL49=00, then answer will be 09
not -01
=TEXT(AL49-1,"00")

Also, if AL48=01 and =TEXT(AL48-2,"00") is used, then the answer is 09, not -01
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Brew

Well-known Member
Joined
Sep 29, 2003
Messages
1,569
Thanks Ken2step , but
How do I include 01 in this formula also?
01 would equal 09, while 00 equal 08
 

fairwinds

MrExcel MVP
Joined
May 15, 2003
Messages
8,638

ADVERTISEMENT

Maybe something like this ?

=TEXT((A1 < A2)*10+A1-A2,"00")
 

Brew

Well-known Member
Joined
Sep 29, 2003
Messages
1,569
The following formula meets all of my conditions, unless Al49 is 00 or 01
=TEXT(AL49-1,"00") .

2 less than 00=08
1 less than 00=09

2less than 01=09
1 less than 01=00

Therefore, show me how do I add
=if(AL49="00","08",Text(AL49-2,"00")) or if Al49=01 then, 09
 

Brew

Well-known Member
Joined
Sep 29, 2003
Messages
1,569

ADVERTISEMENT

I figured this one out. It's the following formula:
=IF(AL48="00","08",IF(AL48="01","09",TEXT(AL48-2,"00")))
Thanks for your help
 

Brew

Well-known Member
Joined
Sep 29, 2003
Messages
1,569
How do I fix this formula to meet my conditions:

=IF(AL48="00","08",TEXT(AL48-2,"00"))or IF(AL48="01","09",TEXT(AL48-2,"01"))
 
Learn Excel from Bill Jelen

Understanding data is crucial, and the easiest place to start is with Microsoft Excel.

Forum statistics

Threads
1,151,563
Messages
5,765,119
Members
425,262
Latest member
sabry

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
Top