Combining formulas

HomePro

Board Regular
Joined
Aug 3, 2021
Messages
157
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2013
  6. 2011
  7. 2010
  8. 2007
  9. 2003 or older
  10. Prefer Not To Say
Platform
  1. Windows
  2. MacOS
  3. Mobile
  4. Web
I am trying to simplify an existing workbook.
I have almost 1000 lines and over 50 headers so reviewing it is an eyesore.

Right now I am creating two columns. the first formula parses the entry from a data cell that looks like:
Single-Family Home (Residential Inspection) ($23.60) | 4 Point Insurance Evaluation ($0.00) | WDO Inspection - FL ONLY - Primo ($50.00)
So if the column header is wdo the cell populates " WDO Inspection - FL ONLY - Primo ($50.00)"
and then the second parses the $ value so the results are 50.00.

Is there anyway I can combine these two formulas into one?
=IFERROR(TRIM(LEFT(SUBSTITUTE(REPLACE($E3,1,SEARCH(G$1,$E3)-1,""),"|",REPT(" ",999)),999)),"")
and
=IFERROR(SUBSTITUTE(REPLACE(G3,1,SEARCH("$",G3),""),")","")+0,"")

If I could get the 50 result and remove 50 columns it would be so much easier.

any ideas?
 
Ok, how about
Excel Formula:
=IFERROR(TRIM(RIGHT(SUBSTITUTE(SUBSTITUTE(REPLACE(REPLACE($BU2,1,SEARCH(DA$1,$BU2)-1,""),FIND("|",REPLACE($BU2,1,SEARCH(DA$1,$BU2)-1,"")&" |")-1,LEN($BU2),""),"$","")," ",REPT(" ",100)),100))*-1,"")
 
Upvote 0

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
I think thats it! still some errors but I think I need to clean up my Criteria.
Your the best!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
I think thats it! still some errors but I think I need to clean up my Criteria.
Your the best!
Ok I see the issue. If the $ amount is negative it does not bring across and value.

Appointment_General_Data.xlsx
BUDADBDCDDDEDFDG
1Pricing_Attributes4 PointAdditional PriceAir SamplingAsbestos TestingCondominiumConvenience FeeDiscount Code
2Single-Family Home (Residential Inspection) ($1323.60) | 4 Point Insurance Evaluation ($0.00) | WDO Inspection - FL ONLY - Primo Pest ($0.00) | Wind Mitigation Assessment ($0.00) | Florida Package ($297.00) | Convenience Fee ($56.72)0    56.72 
3Single-Family Home (Phase 3 - Mattamy - New Construction: Final Inspection) ($424.00) | Sewer Line Inspection ($223.00) | Convenience Fee ($22.65)     22.65 
4WDO Inspection - FL ONLY - Primo Pest ($197.00) | Convenience Fee ($6.90)     6.9 
5WDO Additional Visit - FL ONLY - Primo Pest ($115.00)       
64 Point Insurance Evaluation ($157.00) | Discount Code JWB4PT applied ($-82.00)157      
74 Point Insurance Evaluation ($157.00) | Discount Code JWB4PT applied ($82.00)157     82
Sheet1
Cell Formulas
RangeFormula
DA2:DG7DA2=IFERROR(TRIM(RIGHT(SUBSTITUTE(SUBSTITUTE(REPLACE(REPLACE($BU2,1,SEARCH(DA$1,$BU2)-1,""),FIND("|",REPLACE($BU2,1,SEARCH(DA$1,$BU2)-1,"")&" |")-1,LEN($BU2),""),"$","")," ",REPT(" ",100)),100))*-1,"")
 
Upvote 0
Ok, how about
Excel Formula:
=IFERROR(TRIM(RIGHT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(REPLACE(REPLACE($BU2,1,SEARCH(DA$1,$BU2)-1,""),FIND("|",REPLACE($BU2,1,SEARCH(DA$1,$BU2)-1,"")&" |")-1,LEN($BU2),""),"$",""),"(",""),")","")," ",REPT(" ",100)),100))*1,"")
 
Upvote 0
Solution
It scares me when you say "How About" the first thought is - he's tinkering to see if it might work!
But then I remember its Fluff - the god of code. And clearly it works.
Im sure its not said enough - your a godsend.
Thank you.
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0
actually ran into one issue. after I run the sheet I am copy pasting the cells as values so the data wont change. And when I try to add up cells that include blank cells I get a value error. guess the formula leaves the cells as null. how can I work around this or modify the formula to populate "0"?
 
Upvote 0
How are you trying to add them?
 
Upvote 0
that reminded me --- i can use sum. sry to trouble you.
 
Upvote 0

Forum statistics

Threads
1,216,075
Messages
6,128,665
Members
449,462
Latest member
Chislobog

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