IF D2 contains X then divide I2 by 10

Bassmoore

New Member
Joined
Jan 18, 2012
Messages
18
Hi All,

Have a major problem with our monthly call billing, we basically have a spreadsheet which shows a number called and the total cost of the call.

However our the calls for 0844 & 0845 numbers are 10x the actual cost!

Does anyone know how i can run a macro which will find the 0844 & 0845 numbers in the D column and then if it finds one, divides the total cost in column I by 10 on that particular row?


Thanks!
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
what makes you believe you need vba?

=if(or(left(d1,4)="0844",left(d1,4)="0845"),i1/10,i1)
 
Upvote 0
I would just like to be able to modify the whole sheet without having a different column, is this possible through a macro?
 
Upvote 0
Call Time Destination Called Number Caller ID Duration Cost
1Mar 3, 2015 09:47:50UK Non Geographic Local (Local) - 0844844473737784689436:30:0032.12

<colgroup><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>


That is one row, i couldnt find how to attach the whole document, sorry!
 
Upvote 0
so in that example, because Called Number begins 844 (not 0844 - as in your original post) , you would like the cost of 32.12 to become 3.212 ?
 
Upvote 0
1) in J1
=IF(OR(LEFT(IF(LEFT(F1,1)="0",F1,"0"&F1),4)="0844",LEFT(IF(LEFT(F1,1)="0",F1,"0"&F1),4)="0845"),I1/10,I1)
and copy down the column
2) Copy column J
3) Paste Values over the top of column I
4) Delete column J

You cant attach files on this forum.
You have to upload the file to an online storage site then place a link to it on this forum.
 
Upvote 0
Thanks for your reply, the only issue is, i have loads of other calls on here not just 0844 & 0845 numbers..

Heres the next line:

2Mar 30, 2015 16:00:13UK National (Local) - 01131553281784689415:500.16

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,214,808
Messages
6,121,686
Members
449,048
Latest member
81jamesacct

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