Multiple IF

reza_doang

Board Regular
Joined
May 31, 2010
Messages
185
Hi All,
i just want to have a shortcut for this formula using if or another function.
in 1 column i have value from 1 - 100. now what i want to achieve, IF value
1-3 = 1
4-6 = 2
7-9 = 3
10-12 = 4
13-15 = 5
until
>100 = 31
this is multiple 3
thanks
 

Some videos you may like

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

shemayisroel

Well-known Member
Joined
Sep 11, 2008
Messages
1,867
Something like the below set up should do it

<TABLE style="PADDING-RIGHT: 2pt; PADDING-LEFT: 2pt; FONT-SIZE: 10pt; FONT-FAMILY: Arial,Arial; BACKGROUND-COLOR: #ffffff" cellSpacing=0 cellPadding=0 border=1><COLGROUP><COL style="FONT-WEIGHT: bold; WIDTH: 30px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"><COL style="WIDTH: 64px"></COLGROUP><TBODY><TR style="FONT-WEIGHT: bold; FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center"><TD> </TD><TD>A</TD><TD>B</TD><TD>C</TD><TD>D</TD><TD>E</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">1</TD><TD style="FONT-WEIGHT: bold">MIN</TD><TD style="FONT-WEIGHT: bold">MAX</TD><TD style="FONT-WEIGHT: bold">RESULT</TD><TD style="BACKGROUND-COLOR: #ffff00; TEXT-ALIGN: center">8</TD><TD style="TEXT-ALIGN: center">3</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">2</TD><TD style="TEXT-ALIGN: right">1</TD><TD style="TEXT-ALIGN: right">3</TD><TD style="TEXT-ALIGN: right">1</TD><TD> </TD><TD> </TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">3</TD><TD style="TEXT-ALIGN: right">3</TD><TD style="TEXT-ALIGN: right">6</TD><TD style="TEXT-ALIGN: right">2</TD><TD> </TD><TD> </TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">4</TD><TD style="TEXT-ALIGN: right">6</TD><TD style="TEXT-ALIGN: right">9</TD><TD style="TEXT-ALIGN: right">3</TD><TD> </TD><TD> </TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">5</TD><TD style="TEXT-ALIGN: right">9</TD><TD style="TEXT-ALIGN: right">12</TD><TD style="TEXT-ALIGN: right">4</TD><TD> </TD><TD> </TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">6</TD><TD style="TEXT-ALIGN: right">12</TD><TD style="TEXT-ALIGN: right">15</TD><TD style="TEXT-ALIGN: right">5</TD><TD> </TD><TD> </TD></TR></TBODY></TABLE>
<TABLE style="FONT-SIZE: 10pt; BORDER-LEFT-COLOR: #00ff00; BORDER-BOTTOM-COLOR: #00ff00; COLOR: #000000; BORDER-TOP-STYLE: groove; BORDER-TOP-COLOR: #00ff00; FONT-FAMILY: Arial; BORDER-RIGHT-STYLE: groove; BORDER-LEFT-STYLE: groove; BACKGROUND-COLOR: #fffcf9; BORDER-RIGHT-COLOR: #00ff00; BORDER-BOTTOM-STYLE: groove"><TBODY><TR><TD>Spreadsheet Formulas</TD></TR><TR><TD><TABLE style="FONT-SIZE: 9pt; FONT-FAMILY: Arial" cellSpacing=0 cellPadding=2 border=1><TBODY><TR style="FONT-SIZE: 10pt; BACKGROUND-COLOR: #cacaca"><TD>Cell</TD><TD>Formula</TD></TR><TR><TD>E1</TD><TD>=INDEX(C2:C6,MATCH(D1,A2:A6,1))</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
 

reza_doang

Board Regular
Joined
May 31, 2010
Messages
185
thanks for quick response, but this is not what i want.
My data in 1 column, from 1-100, and i need formula to simple work.
my formula is =IF(D6<=3,1,IF(D6<=6,2,IF(D6<=9,3,....IF(D6<=99,33,34)))))))
now i want to simple it?
thanks
 

shemayisroel

Well-known Member
Joined
Sep 11, 2008
Messages
1,867
Not sure how else you could do it without having a similar set up

The last thing you would want to write is lots and lots of IF's.

Sorry how does you data layout look like? Ar eyou saying that you have it like below?

<TABLE style="PADDING-RIGHT: 2pt; PADDING-LEFT: 2pt; FONT-SIZE: 10pt; FONT-FAMILY: Arial,Arial; BACKGROUND-COLOR: #ffffff" cellSpacing=0 cellPadding=0 border=1><TBODY><TR style="FONT-WEIGHT: bold; FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center"><TD></TD><TD>A</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">1</TD><TD style="FONT-FAMILY: Verdana; TEXT-ALIGN: right">1-3</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">2</TD><TD style="FONT-FAMILY: Verdana; TEXT-ALIGN: right">4-6</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">3</TD><TD style="FONT-FAMILY: Verdana; TEXT-ALIGN: right">7-9</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">4</TD><TD style="FONT-FAMILY: Verdana; TEXT-ALIGN: right">10-12</TD></TR><TR style="HEIGHT: 17px"><TD style="FONT-SIZE: 8pt; BACKGROUND-COLOR: #cacaca; TEXT-ALIGN: center">5</TD><TD style="FONT-FAMILY: Verdana">13-15</TD></TR></TBODY></TABLE>
 

reza_doang

Board Regular
Joined
May 31, 2010
Messages
185

ADVERTISEMENT

something like this.
This is only sample, because if i do that, i need multiple if until <=99
So value in Column A, range between 1 until 100, can have duplicate values. Now in column B, if A between 1-3, B have 1, IF A 4-6, B=2 and soon.

Excel Workbook
AB
111
221
331
442
552
662
773
883
993
10104
11114
12124
13135
14145
15155
16166
17176
Sheet1
 
Last edited:

shift-del

Well-known Member
Joined
Aug 28, 2009
Messages
511
Office Version
365
Platform
Windows
Hello Reza

May be more like this?
<table valign="middle" colspan="3" style="font-family: Calibri; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 11px; font-weight: normal; font-style: normal;" border="1" cellpadding="2" cellspacing="0"><colgroup><col width="28pt"><col width="60pt"><col width="60pt"></colgroup><tbody><tr style="background-color: rgb(250, 250, 250);"><td colspan="3" align="middle">Arbeitsblatt mit dem Namen 'Tabelle2'</td></tr><tr style="background-color: rgb(202, 202, 202);"><td>
</td><td align="middle">A</td><td align="middle">B</td></tr><tr><td style="background-color: rgb(202, 202, 202);" align="middle">1</td><td align="right">1</td><td align="right">1</td></tr><tr><td style="background-color: rgb(202, 202, 202);" align="middle">2</td><td align="right">2</td><td align="right">1</td></tr><tr><td style="background-color: rgb(202, 202, 202);" align="middle">3</td><td align="right">3</td><td align="right">1</td></tr><tr><td style="background-color: rgb(202, 202, 202);" align="middle">4</td><td align="right">4</td><td align="right">2</td></tr><tr><td style="background-color: rgb(202, 202, 202);" align="middle">5</td><td align="right">5</td><td align="right">2</td></tr><tr><td style="background-color: rgb(202, 202, 202);" align="middle">6</td><td align="right">6</td><td align="right">2</td></tr></tbody></table>
<table valign="middle" colspan="2" style="table-layout: auto; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: Calibri; font-size: 10px;" border="3" cellpadding="2" cellspacing="0"><colgroup><col width="40pt"><col></colgroup><tbody><tr style="background-color: rgb(238, 170, 170);"><td>Zelle</td><td>Formel</td></tr><tr><td>B1</td><td>=QUOTIENT(A1+2,3)</td></tr></tbody></table><table style="font-family: Arial; font-size: 7pt;"><tbody><tr><td style="color: rgb(51, 51, 51);">Diese Tabelle wurde mit Tab2Html (v2.4.1) erstellt. ©Gerd alias Bamberg</td></tr></tbody></table>
 

shemayisroel

Well-known Member
Joined
Sep 11, 2008
Messages
1,867
Hello Reza

May be more like this?
<TABLE style="FONT-WEIGHT: normal; FONT-SIZE: 11px; COLOR: rgb(0,0,0); FONT-STYLE: normal; FONT-FAMILY: Calibri; BACKGROUND-COLOR: rgb(255,255,255)" cellSpacing=0 cellPadding=2 border=1 colspan="3" valign="middle"><COLGROUP><COL width=28><COL width=60><COL width=60></COLGROUP><TBODY><TR style="BACKGROUND-COLOR: rgb(250,250,250)"><TD align=middle colSpan=3>Arbeitsblatt mit dem Namen 'Tabelle2'</TD></TR><TR style="BACKGROUND-COLOR: rgb(202,202,202)"><TD>

</TD><TD align=middle>A</TD><TD align=middle>B</TD></TR><TR><TD style="BACKGROUND-COLOR: rgb(202,202,202)" align=middle>1</TD><TD align=right>1</TD><TD align=right>1</TD></TR><TR><TD style="BACKGROUND-COLOR: rgb(202,202,202)" align=middle>2</TD><TD align=right>2</TD><TD align=right>1</TD></TR><TR><TD style="BACKGROUND-COLOR: rgb(202,202,202)" align=middle>3</TD><TD align=right>3</TD><TD align=right>1</TD></TR><TR><TD style="BACKGROUND-COLOR: rgb(202,202,202)" align=middle>4</TD><TD align=right>4</TD><TD align=right>2</TD></TR><TR><TD style="BACKGROUND-COLOR: rgb(202,202,202)" align=middle>5</TD><TD align=right>5</TD><TD align=right>2</TD></TR><TR><TD style="BACKGROUND-COLOR: rgb(202,202,202)" align=middle>6</TD><TD align=right>6</TD><TD align=right>2</TD></TR></TBODY></TABLE>
<TABLE style="TABLE-LAYOUT: auto; FONT-SIZE: 10px; COLOR: rgb(0,0,0); FONT-FAMILY: Calibri; BACKGROUND-COLOR: rgb(255,255,255)" cellSpacing=0 cellPadding=2 border=3 colspan="2" valign="middle"><COLGROUP><COL width=40><COL></COLGROUP><TBODY><TR style="BACKGROUND-COLOR: rgb(238,170,170)"><TD>Zelle</TD><TD>Formel</TD></TR><TR><TD>B1</TD><TD>=QUOTIENT(A1+2,3)</TD></TR></TBODY></TABLE><TABLE style="FONT-SIZE: 7pt; FONT-FAMILY: Arial"><TBODY><TR><TD style="COLOR: rgb(51,51,51)">Diese Tabelle wurde mit Tab2Html (v2.4.1) erstellt. ©Gerd alias Bamberg</TD></TR></TBODY></TABLE>
Thanks for this - never seen this function before. Saved for future. Thanks
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,713
Messages
5,512,996
Members
408,930
Latest member
Michealker

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...
Top