Adding a Negation to IF Statement with Text

APerfectCircle

New Member
Joined
Jul 14, 2018
Messages
3
Hi,

I have the following formula, but need to add an additional piece where I'm stuck.

IF(AND(ISNUMBER(SEARCH($A$1,B3,1)),(H3-G3>3600)),C3*30,H3-G3)

The formula searches for the text "LEASE" in B3, it then calculates the difference between two dates (H3-G3), if the result is greater than 3600, then it multiplies C3*30, if not, then H3-B3.

However, I need to add another part where if B3 does not contain "LEASE", then it will multiply G6*30

Any help is appreciated.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Hi,

Not entirely sure what you mean, if this does not do what you need, please explain in detail the logic you want the formula to follow:


Book1
J
10
Sheet132
Cell Formulas
RangeFormula
J1=IF(H3-G3>3600,IF(ISNUMBER(SEARCH($A$1,B3)),C3*30,G6*30),H3-G3)
 
Upvote 0
Thank you for your reply.

The problem is that those records not containing "Lease", cell A1, do not have an end date, H3. For these items, it should simply be G6*30.

If I apply your suggestion and H3 is blank, then it returns a negative value.
 
Upvote 0
Ok, so if I understand correctly, how does this work for you:


Book1
J
20
Sheet132
Cell Formulas
RangeFormula
J2=IF(ISNUMBER(SEARCH($A$1,B3)),IF(H3-G3>3600,C3*30,H3-G3),G6*30)
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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
Back
Top