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?
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
In the off chance that the following helps.
The "-" coerces the text in brackets to a positive number.

Single-Family Home (Residential Inspection) ($23.60) | 4 Point Insurance Evaluation ($0.00) | WDO Inspection - FL ONLY - Primo ($50.00)($50.00)
50.00​
Single-Family Home (Residential Inspection) ($23.60) | 4 Point Insurance Evaluation ($0.00) | WDO Inspection - FL ONLY - Primo ($999.99)($999.99)
999.99​
0.00​
1,049.99​
 
Upvote 0
Upvote 0
OMG. Thought I was done with this..... Seems that for some entries the formula is posting a 0 that is creating me issues elsewhere.
Anyway around this, can we just have it print ""? [blank like the adjacent cells?]

Appointment_General_Data.xlsx
BUDADBDCDDDEDF
1Pricing_Attributes4 PointAdditional PriceAir SamplingAsbestos TestingCondominiumConvenience Fee
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)056.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
Sheet1
 
Upvote 0
With xl 2016 you need to double up on the formula like
Excel Formula:
=IF(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,"")=0,"",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
That is just so Beyond me. Happy your here to help!
Thanks again
 
Upvote 0
Hey Fluff,
Hope your still watching this.
Below is your code that I am using. If it does not find a response the cell is left null.
Can we make it so it populates a 0 instead of "".
I tried but could not get to to work

eds.xlsx
DADBDC
14 PointAdditional PriceAir Sampling
2 15 
3   
4   
5   
Sheet1
Cell Formulas
RangeFormula
DA2:DC5DA2=IF(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,"")=0,"",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
Try changing the final "" to 0
 
Upvote 0
almost worked - still leaves a few ""

eds.xlsx
DADBDCDD
14 PointAdditional PriceAir SamplingAsbestos Testing
201500
30000
4 000
5 000
60000
7851000
8157000
9157000
Sheet1
Cell Formulas
RangeFormula
DA2:DD9DA2=IF(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,"")=0,"",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,0))
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,605
Members
449,089
Latest member
Motoracer88

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