2 Criteria IF Statement

markhib

New Member
Joined
Apr 21, 2008
Messages
19
simply want to say if Home Team is A, and Home Score is greater than Away Score, use AHW (A Home Win)


Only bothered about teams A & B so 8 possible combinations.

Hope someone can help me..

Thanks

A</SPAN>B</SPAN>C</SPAN>D</SPAN>E</SPAN>
1</SPAN>Home Team</SPAN></SPAN>HomeScore</SPAN>Away Score</SPAN>Away Team</SPAN></SPAN>Result</SPAN>
2</SPAN>A</SPAN></SPAN>1</SPAN>2</SPAN>C</SPAN></SPAN>AHL</SPAN>
3</SPAN>A</SPAN></SPAN>3</SPAN>0</SPAN>D</SPAN></SPAN>AHW</SPAN>
4</SPAN>B</SPAN></SPAN>4</SPAN>1</SPAN>E</SPAN></SPAN>BHW</SPAN>
5</SPAN>B</SPAN></SPAN>2</SPAN>3</SPAN>F</SPAN></SPAN>BHL</SPAN>
6</SPAN>G</SPAN></SPAN>3</SPAN>2</SPAN>A</SPAN></SPAN>AAL</SPAN>
7</SPAN>H</SPAN></SPAN>1</SPAN>2</SPAN>A</SPAN></SPAN>AAW</SPAN>
8</SPAN>D</SPAN>5</SPAN>1</SPAN>B</SPAN>BAL</SPAN>
9</SPAN>C</SPAN>1</SPAN>3</SPAN>B</SPAN>BAW</SPAN>

<TBODY>
</TBODY><COLGROUP><COL><COL><COL span=3><COL></COLGROUP>
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
simply want to say if Home Team is A, and Home Score is greater than Away Score, use AHW (A Home Win)


Only bothered about teams A & B so 8 possible combinations.

Hope someone can help me..

Thanks

ABCDE
1Home TeamHomeScoreAway ScoreAway TeamResult
2A12CAHL
3A30DAHW
4B41EBHW
5B23FBHL
6G32AAAL
7H12AAAW
8D51BBAL
9C13BBAW

May be this...

Excel Workbook
ABCDE
1Home TeamHome ScoreAway TeamAway ScoreResult
2A3P2AHW
3B2O1BHW
4C6L4CHW
5D5T3DHW
6E4E5EHL
7F2Q1FHW
Sheet9
 
Upvote 0
Use the following formula in Cell F2 and copy down:

=IF(B2>C2,A2&"HW","")

Hope this helps.
 
Upvote 0
=if(or(a2={"a","b"}),a2&"h"&if(b2>c2,"w","l"),if(or(d2={"a","b"}),d2&"a"&if(b2>c2,"l","w")))

Are you sure the formula is working...?
Excel Workbook
ABCDE
1Home TeamHome ScoreAway TeamAway ScoreResult
2A3P2Ahl
Sheet9
 
Upvote 0
Are you sure the formula is working...?
Sheet9

ABCDE
1Home TeamHome ScoreAway TeamAway ScoreResult
2A3P2Ahl

<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>

Spreadsheet Formulas
CellFormula
E2=IF(OR(A2={"a","b"}),A2&"h"&IF(B2>C2,"w","l"),IF(OR(D2={"a","b"}),D2&"a"&IF(B2>C2,"l","w")))

works here:
Excel Workbook
ABCDEF
1Home TeamHomeScoreAway ScoreAway TeamResult
2A12CAHLAhl
3A30DAHWAhw
4B41EBHWBhw
5B23FBHLBhl
6G32AAALAal
7H12AAAWAaw
8D51BBALBal
9C13BBAWBaw
10A32PAhw
Sheet1
 
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,028
Members
448,940
Latest member
mdusw

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