IF Formula not working - Trying to Search, AND and Round up.

desibouy

Board Regular
Joined
Nov 20, 2014
Messages
98
Office Version
  1. 365
Platform
  1. Windows
Hi,

I'm having problems trying to do this formula and it just doesn't want to work :( Please can anyone help me?



=IF(JH2="13",CEILING(JD2/0.68+13,0.5)-0.01,""),IF(AND(JH2="6.95",(JD2/0.68))<50,CEILING(JD2/0.68+3,0.5)-0.01,CEILING(JD2/0.68+6.95,0.5)-0.01),IF(AND(M2="CA",ISNUMBER(SEARCH(S2,"INCONTINENCE"))),CEILING(JD2/0.68+6.95,0.5)-0.01,""))


Basically it reads,

IF Freight price is 13 THEN to Divide the Cost price by .68 and ADD the 13.

IF Freight price is 6.95 AND the Cost Price Divide .68 is LESS than $50 THEN add $3.00 ELSE ADD 6.95.

IF M2 (which is Unit of Measurement) has CA AND Column S2 (which is the category) contains the word "Incontinence" THEN calculate Cost Price Divide .68 and add 6.95 Regardless.

Everything is rounded up.





P.S- forgive me if the title is wrong.
 
Wow Thanks Man,


See this sample sheet -

Mega File Upload - Sample Sheet.xlsx

Thanks again


Can't believe I can't edit my own posts however just to iterate and sorry for creating loads of posts.

I am trying to find the correct selling price using the right freight.
to figure out selling price you do cost price divide .68 (Caluclation)

1. if item has 13 in Freight column then to the end of Calulation.

2. If price is 6.95 and below $50 then $3.00 else $6.95

3. if M2 (UOM) has "CA" and has incontinence in Matrix Parent only then add $6.95.

Thanks Again
 
Upvote 0

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Can't believe I can't edit my own posts however just to iterate and sorry for creating loads of posts.

I am trying to find the correct selling price using the right freight.
to figure out selling price you do cost price divide .68 (Caluclation)

1. if item has 13 in Freight column then to the end of Calulation.

2. If price is 6.95 and below $50 then $3.00 else $6.95

3. if M2 (UOM) has "CA" and has incontinence in Matrix Parent only then add $6.95.
Thanks Again

Is M2 (UOM) Column M with header "MAP", and Matrix Parent Column C in your sample sheet?
 
Upvote 0
Is M2 (UOM) Column M with header "MAP", and Matrix Parent Column C in your sample sheet?


I deleted some fields which weren't relevant however I've just uploaded another file. All fields on there now.

Sorry man
 
Upvote 0
Ignore Column C5. That's wrong.

Matrix Type is Column F.

M2 is UOM.

S2 is Column type.

Is there a chat thing on here which would make it easy to talk?
 
Upvote 0
Not entirely sure if I understand what you mean, but try this and see if it works for you.

Code:
 =IF(AND(M2="CA",ISNUMBER(SEARCH("INCONTINENCE",S2)),ISNUMBER(SEARCH("PARENT",F2))),CEILING(JD2/0.68+6.95,0.5)-0.01,IF(JH2=13,CEILING(JD2/0.68+13,0.5)-0.01,IF(AND(JH2=6.95,(JD2/0.68)<50),CEILING(JD2/0.68+3,0.5)-0.01,CEILING(JD2/0.68+6.95,0.5)-0.01)))

And no, there's no chat on this forum.
 
Upvote 0
Not entirely sure if I understand what you mean, but try this and see if it works for you.

Code:
 =IF(AND(M2="CA",ISNUMBER(SEARCH("INCONTINENCE",S2)),ISNUMBER(SEARCH("PARENT",F2))),CEILING(JD2/0.68+6.95,0.5)-0.01,IF(JH2=13,CEILING(JD2/0.68+13,0.5)-0.01,IF(AND(JH2=6.95,(JD2/0.68)<50),CEILING(JD2/0.68+3,0.5)-0.01,CEILING(JD2/0.68+6.95,0.5)-0.01)))

And no, there's no chat on this forum.


DUDE this is AWESOME! Works Great Thank You, Thank You Thank You :) Absolute Life Saver.
 
Upvote 0
Hi Jtakw,

When I randomly checked it all looked well and it worked. However looking closely it's not working but kinda is. For some reason the 3rd Rule/Condition doesn't work -- "if M2 (UOM) has "CA" and contains the word incontinence in the Matrix Parent Row then add $6.95". Ignoring the 2nd condition but not the 1st condition.

I've re-uploaded the file in Dropbox and also added a Column in there showing the correct price for those Cases. It's only missing like $3.00


When I say it's kinda working, it's because anything above $50 the 6.95 is working fine but I guess this is because of the 2nd Condition - If cost price / .68 and and is
below $50 then $3.00 else $6.95.


Does that make sense?




https://www.dropbox.com/s/op9kpmvw8vyqu8b/Sample%20Sheet.xlsx?dl=0
 
Upvote 0
OK, two ways to fix this:

First way:


Excel 2010
FGMSJDJEJH
1Matrix TypeSub Item OfUOMSite Category 1Inventory Purchase PriceSelling PriceFreight
2Parent Matrix ItemIncontinence Supplies : Underwear10.6818.996.95
3Child Matrix ItemProtection Plus Classic Protective UnderwearCAIncontinence Supplies : Underwear3254.496.95
4Child Matrix ItemProtection Plus Classic Protective UnderwearBGIncontinence Supplies : Underwear11.8220.496.95
5Child Matrix ItemProtection Plus Classic Protective UnderwearCAIncontinence Supplies : Underwear32.2854.496.95
6Child Matrix ItemProtection Plus Classic Protective UnderwearBGIncontinence Supplies : Underwear10.7618.996.95
7Child Matrix ItemProtection Plus Classic Protective UnderwearCAIncontinence Supplies : Underwear3152.996.95
8Child Matrix ItemProtection Plus Classic Protective UnderwearBGIncontinence Supplies : Underwear10.6818.996.95
9Child Matrix ItemProtection Plus Classic Protective UnderwearCAIncontinence Supplies : Underwear3051.496.95
10Child Matrix ItemProtection Plus Classic Protective UnderwearBGIncontinence Supplies : Underwear10.6818.996.95
11Child Matrix ItemProtection Plus Classic Protective UnderwearCAIncontinence Supplies : Underwear3254.496.95
12Child Matrix ItemProtection Plus Classic Protective UnderwearBGIncontinence Supplies : Underwear11.720.496.95
13Parent Matrix Item
14Child Matrix ItemDeluxe 3-in-1 Bedside Steel Commode
15Child Matrix ItemDeluxe 3-in-1 Bedside Steel Commode
Sheet1
Cell Formulas
RangeFormula
S3=IF(G3<>"",S2,"")
JE2=IF(AND(M2="CA",ISNUMBER(SEARCH("INCONTINENCE",S2))),CEILING(JD2/0.68+6.95,0.5)-0.01,IF(JH2=13,CEILING(JD2/0.68+13,0.5)-0.01,IF(AND(JH2=6.95,(JD2/0.68)<50),CEILING(JD2/0.68+3,0.5)-0.01,CEILING(JD2/0.68+6.95,0.5)-0.01)))


Copy S3 formula down Column S, copy JE2 formula down Column JE.
However, if you want to preserve the appearance of your sheet, then do it this way:


Excel 2010
FGMSTJEJFJI
1Matrix TypeSub Item OfUOMSite Category 1Inventory Purchase PriceSelling PriceFreight
2Parent Matrix ItemIncontinence Supplies : UnderwearIncontinence Supplies : Underwear10.6818.996.95
3Child Matrix ItemProtection Plus Classic Protective UnderwearCAIncontinence Supplies : Underwear326.95
4Child Matrix ItemProtection Plus Classic Protective UnderwearBG11.826.95
5Child Matrix ItemProtection Plus Classic Protective UnderwearCA32.286.95
6Child Matrix ItemProtection Plus Classic Protective UnderwearBG10.766.95
7Child Matrix ItemProtection Plus Classic Protective UnderwearCA316.95
8Child Matrix ItemProtection Plus Classic Protective UnderwearBG10.686.95
9Child Matrix ItemProtection Plus Classic Protective UnderwearCA306.95
10Child Matrix ItemProtection Plus Classic Protective UnderwearBG10.686.95
11Child Matrix ItemProtection Plus Classic Protective UnderwearCA326.95
12Child Matrix ItemProtection Plus Classic Protective UnderwearBG11.76.95
13Parent Matrix Item
14Child Matrix ItemDeluxe 3-in-1 Bedside Steel Commode
15Child Matrix ItemDeluxe 3-in-1 Bedside Steel Commode
16Hide this Column
Sheet1
Cell Formulas
RangeFormula
T2=S2
T3=IF(G3<>"",T2,"")
JF2=IF(AND(M2="CA",ISNUMBER(SEARCH("INCONTINENCE",T2))),CEILING(JE2/0.68+6.95,0.5)-0.01,IF(JI2=13,CEILING(JE2/0.68+13,0.5)-0.01,IF(AND(JI2=6.95,(JE2/0.68)<50),CEILING(JE2/0.68+3,0.5)-0.01,CEILING(JE2/0.68+6.95,0.5)-0.01)))


Insert a new Column after Column S, new Column will be T, enter formula in T2, enter formula in T3 and copy down, hide Column T, enter formula in JF and copy down.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,900
Messages
6,175,276
Members
452,629
Latest member
SahilPolekar

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