If column E contains x - do this, if contains y - so that, etc

mtaylor

Board Regular
Joined
May 1, 2013
Messages
73
Platform
  1. Windows
  2. MacOS
Hi - thanks for looking.

I have responses being inputted to a sheet and I want formulas run depending on the text in cells in Column E

The different responses are:

Double Sided, A4
Double Sided, A5/2 On 1pg
Double Sided
Single Sided
Double Sided
Single Sided

Then the formulas in column H are:

=((ROUNDUP(F2/2)*G2))

=((ROUNDUP(F3/4)*G3))

=((ROUNDUP(F4/2)*G4))

=G5*F5

=((ROUNDUP(F6/2)*G6))

=G7*F7


repro sheet.JPG


So for example:

If E3 says "Double Sided, A4" I want the formula "=((ROUNDUP(F2/2)*G2))" to be run etc

Hopefully this makes a little sense?

Thanks in advance
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hello,

=IF(K13="Double Sided, A4",((ROUNDUP(F2/2)*G2)),"")

The "" at the end is what is shown if it is not equal (an empty cell), you can change that to whatever you want.

Jamie
 
Upvote 0
Hello,

=IF(K13="Double Sided, A4",((ROUNDUP(F2/2)*G2)),"")

The "" at the end is what is shown if it is not equal (an empty cell), you can change that to whatever you want.

Jamie
Cheers Jamie,

I had a look and tried the below: with IFS function:

=IFS(E2="Double Sided, A4",((ROUNDUP((F2/2)*G2)),""),(E2="Double Sided, A5/2 On 1pg",((ROUNDUP(F2/4)*G2)),"")E2=),(E2="Double Sided",((ROUNDUP(F2/2)*G2)),""),(E2="Single Sided",(G2*F2),"")

Thanks again
 
Upvote 0
Cheers Jamie,

I had a look and tried the below: with IFS function:

=IFS(E2="Double Sided, A4",((ROUNDUP((F2/2)*G2)),""),(E2="Double Sided, A5/2 On 1pg",((ROUNDUP(F2/4)*G2)),"")E2=),(E2="Double Sided",((ROUNDUP(F2/2)*G2)),""),(E2="Single Sided",(G2*F2),"")

Thanks again

=IFS(E2="Double Sided, A4",((ROUNDUP((F2/2)*G2)),""),(E2="Double Sided, A5/2 On 1pg",((ROUNDUP(F2/4)*G2)),""),(E2="Double Sided",((ROUNDUP(F2/2)*G2)),""),(E2="Single Sided",(G2*F2),""))
 
Upvote 0
Hi,

I think this should do what you want:

Book3.xlsx
EFGH
1#Original#Copy#Printouts
2Double Sided, A422020
3Double Sided, A5/2 On 1pg884168
4Double Sided384168
5Single Sided32678
6Double Sided31020
7Single Sided2612
Sheet1042
Cell Formulas
RangeFormula
H2:H7H2=ROUNDUP(F2/MAX((((ISNUMBER(SEARCH("2 On 1",E2))+ISNUMBER(SEARCH("Double",E2)))*2)),1),0)*G2
 
Upvote 0
Hi again, providing Shorter version of my formula in H2:

Book3.xlsx
EFGHI
1#Original#Copy#Printouts#Printouts
2Double Sided, A42202020
3Double Sided, A5/2 On 1pg884168168
4Double Sided384168168
5Single Sided3267878
6Double Sided3102020
7Single Sided261212
Sheet1042
Cell Formulas
RangeFormula
H2:H7H2=ROUNDUP(F2/MAX(SUM(COUNTIF(E2,{"*2 On 1*","*Double*"}))*2,1),0)*G2
I2:I7I2=ROUNDUP(F2/MAX((((ISNUMBER(SEARCH("2 On 1",E2))+ISNUMBER(SEARCH("Double",E2)))*2)),1),0)*G2
 
Upvote 0
Hi again, providing Shorter version of my formula in H2:

Book3.xlsx
EFGHI
1#Original#Copy#Printouts#Printouts
2Double Sided, A42202020
3Double Sided, A5/2 On 1pg884168168
4Double Sided384168168
5Single Sided3267878
6Double Sided3102020
7Single Sided261212
Sheet1042
Cell Formulas
RangeFormula
H2:H7H2=ROUNDUP(F2/MAX(SUM(COUNTIF(E2,{"*2 On 1*","*Double*"}))*2,1),0)*G2
I2:I7I2=ROUNDUP(F2/MAX((((ISNUMBER(SEARCH("2 On 1",E2))+ISNUMBER(SEARCH("Double",E2)))*2)),1),0)*G2

Thank you,

I need all the formulas in one cell though, hence I was looking at the IFS function.

Where have I gone wrong here:

=IFS(E2="Double Sided, A4",((ROUNDUP((F2/2)*G2)),""),(E2="Double Sided, A5/2 On 1pg",((ROUNDUP(F2/4)*G2)),""),(E2="Double Sided",((ROUNDUP(F2/2)*G2)),""),(E2="Single Sided",(G2*F2),""))
 
Upvote 0
Try this:

Excel Formula:
=IFS(E2="Double Sided, A4", ROUNDUP(F2/2*G2,0),
         E2="Double Sided, A5/2 On 1pg",ROUNDUP(F2/4*G2,0),
         E2="Double Sided",ROUNDUP(F2/2*G2,0),
         E2="Single Sided",(G2*F2),
         TRUE,"")
 
Upvote 0
Solution

Forum statistics

Threads
1,215,219
Messages
6,123,687
Members
449,117
Latest member
Aaagu

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