Modifier cell that contains both operator and value

starchyfind

New Member
Joined
Jan 6, 2010
Messages
7
I'm trying to incorporate a new feature into an already existing spreadsheet I maintain, but I'm having trouble finding the right functions and/or logic. Basically, I'm trying to give the user a column (in this case, B, in the table below), which will allow the value in Column C to be modified depending on the value and operator entered in Column B. I'd like this functionality to be limited to a single column (or single cell per row, as the case may be).

How can I make my existing formula work or what is a better method?

This is how I'd like the logic function, but it only works with the "*" operator:

ABC
1=IF(SEARCH("~*",B2,1),C2*RIGHT(B2,1),IF(SEARCH("/",B2,1),C2/RIGHT(B2,1),IF(OR(B2<0,B2>0),SUM(C2,B2))))
510
2=IF(SEARCH("~*",B3,1),C3*RIGHT(B3,1),IF(SEARCH("/",B3,1),C3/RIGHT(B3,1),IF(OR(B3<0,B3>0),SUM(C3,B3))))
-510
3=IF(SEARCH("~*",B4,1),C4*RIGHT(B4,1),IF(SEARCH("/",B4,1),C4/RIGHT(B4,1),IF(OR(B4<0,B4>0),SUM(C4,B4))))
*510
4=IF(SEARCH("~*",B5,1),C5*RIGHT(B5,1),IF(SEARCH("/",B5,1),C5/RIGHT(B5,1),IF(OR(B5<0,B5>0),SUM(C5,B5))))/5
10

<tbody>
</tbody>

Thanks.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
If you want to modify the value in C, depending on the value in B, then why is your formula in A?
 
Upvote 0
If you want to modify the value in C, depending on the value in B, then why is your formula in A?

The value in C is reference to elsewhere in the spreadsheet, and wants to remain both unchanged and visible to the user. The value in A is the value in C multiplied by a referenced mark-up percentage. What I want to be able to do is affect the result of C*mark-up in column A by whatever is entered into column B. Hopefully that makes sense.
 
Upvote 0
OK, and these are only the mathematical operators +-/* ?

Formula in A14:
Code:
=IF(LEFT(B14,1)="+",RIGHT(B14,LEN(B14)-1)+C14,IF(LEFT(B14,1)="-",-RIGHT(B14,LEN(B14)-1)+C14,IF(LEFT(B14,1)="*",RIGHT(B14,LEN(B14)-1)*C14,IF(LEFT(B14,1)="/",C14/RIGHT(B14,LEN(B14)-1),ERROR.TYPE(#VALUE!)))))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,278
Messages
6,124,023
Members
449,139
Latest member
sramesh1024

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