Add a condition to a formula

Brew

Well-known Member
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.

ken2step

Well-known Member
=if(AL48="00","08",Text(AL48-2,"00"))

is this what you want?
ken

MrExcel MVP
=TEXT(AL48-IF(N(AL48),2,0),"00")

Same setup for AL49 with 2 replaced with 1.

Brew

Well-known Member
Thanks Ken2step , but
How do I include 01 in this formula also?
01 would equal 09, while 00 equal 08

fairwinds

MrExcel MVP

Maybe something like this ?

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

Brew

Well-known Member
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

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

fairwinds

MrExcel MVP
=TEXT((AL49 < 2)*10+AL49-2,"00")

Brew

Well-known Member
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"))

fairwinds

MrExcel MVP
Try the formula I posted twice now Replies
1
Views
51
Replies
3
Views
122
Replies
2
Views
47
Replies
1
Views
60
Replies
2
Views
125 Understanding data is crucial, and the easiest place to start is with Microsoft Excel.

Forum statistics

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.    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

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